Commit Graph

1115 Commits

Author SHA1 Message Date
Mateusz Pusz 036efbdc0b feat(scripts): two-axis character labels and a merged Traits column in the reference
Update the systems reference generator for the two-axis quantity character and to reduce
the quantities table width:

- The Character column now prints the order with a `complex` prefix only when the field is
  complex (`scalar`, `complex scalar`, `vector`, `tensor`, `complex vector`,
  `complex tensor`), replacing the old `Real`/`Complex`/`Vector`/`Tensor` labels that mixed
  the two axes and could not express complex vectors or tensors.
- The separate `is_kind` and `non_negative` boolean columns are merged into one `Traits`
  column that shows `kind` and/or `≥ 0` only when set (blank otherwise), dropping a column
  and the per-row ticks.

Regenerated the affected systems reference pages.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-25 00:21:18 +02:00
Mateusz Pusz d4230f46c5 chore(docs): refresh systems reference source-hash cache after character migration
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-25 00:10:46 +02:00
Mateusz Pusz 199cc49a7e fix(scripts): update systems reference generator for the two-axis quantity_character
The QUANTITY_SPEC parser only recognized `quantity_character::` as a character override,
and the generated metadata-extraction program `switch`ed over the character enum. Both
broke once the ISQ definitions moved to the `quantity_tensor_order` / `quantity_field`
spelling and `quantity_character` became a struct.

- Treat `quantity_tensor_order::` and `quantity_field::` (alongside `quantity_character::`)
  as character overrides when deciding whether the third macro argument is an equation.
- Rewrite `character_to_string` to compare against the two-axis values instead of switching
  on an enum.

The regenerated reference is byte-identical (only the source hash changes).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-24 23:53:58 +02:00
Mateusz Pusz 87257a6c5d refactor: Vector implemented in terms of Tensor 2026-06-24 22:52:24 +02:00
Mateusz Pusz 7ec072cd7b style: markdownlint-cli2 added to pre-commit 2026-06-23 23:03:04 +02:00
Mateusz Pusz d37414ac7b feat: vector quantity decomposition support added 2026-06-23 16:11:47 +02:00
Mateusz Pusz 42444316b6 docs: linear algebra blog post added 2026-06-22 19:20:00 +02:00
Mateusz Pusz 5c8c4ad5ae feat: external linear algebra libraries integrations added + quantity::magnitude() member function
Resolves #301
2026-06-22 18:51:56 +02:00
Mateusz Pusz 6f05862a12 docs: Brno 2026 meeting report added 2026-06-13 23:32:59 +02:00
Mateusz Pusz c4b30d9b60 Merge branch 'master' of github.com:mpusz/units 2026-06-12 23:09:41 +02:00
Mateusz Pusz 4c7639942e refactor: norm() replaced with magnitude() for vector representation types 2026-06-12 22:25:26 +02:00
Mateusz Pusz 7f1e417c06 docs: system reference cache updated 2026-06-12 09:44:57 +02:00
Mateusz Pusz 5072c138ee docs: "Two levels of format specification" chapter added 2026-06-12 09:44:28 +02:00
Mateusz Pusz 1c54623024 feat: import std; enabled for g++ 2026-06-03 21:29:55 +02:00
Mateusz Pusz 8df25adeef docs: use cl-style 19.5+ for MSVC in compiler support table
The previous `195+` is the Conan-side encoding (matching
`_feature_compatibility` in conanfile.py) and is ambiguous in prose —
the digits collide with `_MSC_VER`/cl-version/toolset variants. The
cl-version `19.5+` is what users see from `cl /version`, and what's
already used in src/CMakeLists.txt when this project talks about MSVC
versions. Realign the MSVC column to accommodate the wider cell.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-26 16:47:45 +02:00
Mateusz Pusz 96965634f5 feat: support import std; on MSVC
mp-units' minimum-supported MSVC 195 (VS 2026) has solid `import std;`
support, but enabling `-o import_std=True` against the build hit two
issues that this change fixes.

(1) Module scanning was only enabled when `cxx_modules=True`.

Without `CMAKE_CXX_SCAN_FOR_MODULES=ON`, CMake doesn't link the implicit
std module BMI into non-module translation units that do `import std;`,
producing C2230 "could not find module 'std'". Enable scanning whenever
`import_std=True` as well. Same bug fixed in `test_package/conanfile.py`.

(2) The std module BMI is built with mismatched compile flags.

CMake materializes the implicit std module BMI as `__cmake_cxx_std_NN`,
a separate internal target that does not link mp-units and therefore
does not inherit mp-units' target-level options. On MSVC this caused
C5050 (`_UTF8` defined on consumer but not on module command line) and
on Clang 21 there is a parallel `-Wreserved-module-identifier` issue
already partially handled in `src/CMakeLists.txt` but in a directory
scope that did not actually reach the BMI either.

Consolidate the workarounds into one `src/cmake/import-std-setup.cmake`
snippet that applies the flags project-wide via `add_compile_options`,
self-guarded by `if(NOT CMAKE_CXX_MODULE_STD) return()`. It is included
from every entry point so all delivery paths converge:
  - top-level `CMakeLists.txt` for the dev build
  - bundled `mp-unitsConfig.cmake` for `find_package` consumers
  - via `cmake_build_modules` in `package_info()` for Conan-generated
    configs (the `cxx_modules=False` consumer path)

Other pieces:
  - `test/static/unit_magnitude_test.cpp` was the only test in the repo
    missing the `MP_UNITS_IMPORT_STD` gate around `#include <type_traits>`,
    causing duplicate `std::integral_constant` definitions in this
    configuration.
  - Compiler support table announces MSVC 195+ for `import std;`.
  - Installation docs gain a consumer-side setup note covering the
    CMake cache variables required, what mp-units handles automatically
    via the snippet, and the `add_subdirectory`-vendored caveat.

Verified: `conan build . -pr msvc195 -o '&:cxx_modules=False'
-o '&:import_std=True' -s compiler.cppstd=23 -c
user.mp-units.build:all=True` -> 40/40 tests pass.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-25 23:45:51 +02:00
Mateusz Pusz 393c671608 docs: MSVC 195 works with mp-units now
Resolves #761
2026-05-24 21:46:41 +02:00
Mateusz Pusz 982fc526c0 feat: 💥 quantity_from_unit_zero() renamed back to quanity_from_zero() and limited to default_point_origin + qp.in(Unit) changes the origin for offset units 2026-05-21 22:46:12 +02:00
Mateusz Pusz 2690296059 feat: quantity_point text output added for default_point_origin 2026-05-21 18:38:09 +02:00
Mateusz Pusz 779d78fce9 docs: P4185 added to the docs welcome page 2026-05-15 09:51:08 +02:00
Mateusz Pusz 6e6ff299b5 feat(example): trade_execution example added 2026-05-14 19:57:28 +02:00
Mateusz Pusz 995d5dda5f docs: workaround from "Custom Quantity Specifications" workshop removed 2026-05-14 19:06:49 +02:00
Mateusz Pusz 257c51ccc4 docs: Compiler Explorer links updated 2026-05-14 19:06:16 +02:00
Mateusz Pusz 47fdf2254b docs: frame projections tutorial added 2026-05-13 19:13:27 +02:00
Mateusz Pusz 2de1a2ff04 docs: header files with customization points updated 2026-05-13 19:12:46 +02:00
Mateusz Pusz 013c23be22 docs: quantity safety post now references absolute quantities post 2026-05-13 19:04:42 +02:00
Mateusz Pusz 478f86eedc feat(example): geographic.h now supports converting between bearing and azimuth 2026-05-13 19:00:22 +02:00
Mateusz Pusz 7899bf4ca8 feat: explicit constructor between point in projected frames added 2026-05-13 18:11:27 +02:00
Mateusz Pusz c93778010f feat: 💥 final is not longer required for definitions and should not be used for quantity_spec 2026-05-13 15:23:47 +02:00
Mateusz Pusz 72ca96ee52 feat: frame projections support added 2026-05-12 23:02:09 +02:00
Mateusz Pusz 9ba6d2e0f6 docs: Absolute Quantities blog article updated 2026-05-12 21:42:59 +02:00
Mateusz Pusz c1212bf4da docs: "Representation Types" chapter updated 2026-05-12 20:42:15 +02:00
Mateusz Pusz 1ac0fe5336 docs: affine space SVG updated 2026-05-12 20:27:42 +02:00
Mateusz Pusz 3a27e34ea6 docs: system reference cache updated 2026-05-06 22:54:59 +02:00
Mateusz Pusz 4161608a92 docs: point origin inheritance docs added 2026-05-06 22:35:58 +02:00
Mateusz Pusz 1b8b6d222a feat: kind_of applied to more derived SI units + some quantity_spec hierarchies improved 2026-05-06 22:34:40 +02:00
Mateusz Pusz 2978c1963f fix: missing constraints for qp.quantity_from_unit_zero() added + fixed all incorrect usa cases 2026-05-06 22:12:50 +02:00
Mateusz Pusz b12fe30925 feat: non-negativity can't be determined from the equation 2026-05-01 11:41:12 +02:00
Mateusz Pusz 0de0438d76 docs: '?' removed from headers with nominal clauses 2026-04-30 15:57:07 +02:00
Mateusz Pusz 423db353e1 feat(example): currency example improved
Co-authored-by: Copilot <copilot@github.com>
2026-04-30 14:07:35 +02:00
Mateusz Pusz 477b8eb7f1 docs: marking of subkinds in hierarchies changed to subgraphs
Co-authored-by: Copilot <copilot@github.com>
2026-04-29 19:20:14 +02:00
Mateusz Pusz 251a8fd132 feat: Natural Units support finalized
Co-authored-by: Copilot <copilot@github.com>
2026-04-29 16:16:25 +02:00
Mateusz Pusz 08ba2200eb docs: Users Guide index updated with safe_int
Co-authored-by: Copilot <copilot@github.com>
2026-04-28 21:32:00 +02:00
Mateusz Pusz 10978e582f docs: "Overview" chapter removed from the systems descriptions in the Users Guide 2026-04-28 21:25:16 +02:00
Mateusz Pusz c3d5fc6dbb docs: non_negative declarations added to quantity_spec in docs
Co-authored-by: Copilot <copilot@github.com>
2026-04-28 21:10:01 +02:00
René Paris df8c264e24 Fix quantity calculation from subtraction to addition 2026-04-28 19:33:36 +02:00
Mateusz Pusz 810c5a9c41 docs: quantity point bounds documentation updated
Co-authored-by: Copilot <copilot@github.com>
2026-04-28 10:49:24 +02:00
Mateusz Pusz 7b2603a8ba docs: safe_int documentation improved 2026-04-27 23:28:12 +02:00
Mateusz Pusz d96d977845 style: pre-commit 2026-04-27 18:43:39 +02:00
Mateusz Pusz 9b1734e319 docs: "Representation Types" chapter contents restored
Co-authored-by: Copilot <copilot@github.com>
2026-04-27 14:37:47 +02:00