ucon 2.2.2__tar.gz → 2.4.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {ucon-2.2.2 → ucon-2.4.0}/CHANGELOG.md +591 -0
- {ucon-2.2.2/ucon.egg-info → ucon-2.4.0}/PKG-INFO +1 -1
- {ucon-2.2.2 → ucon-2.4.0}/ROADMAP.md +93 -19
- {ucon-2.2.2 → ucon-2.4.0}/ucon/__init__.py +10 -0
- {ucon-2.2.2 → ucon-2.4.0}/ucon/_cache.py +86 -1
- {ucon-2.2.2 → ucon-2.4.0}/ucon/aspects/__init__.py +2 -0
- {ucon-2.2.2 → ucon-2.4.0}/ucon/aspects/exceptions.py +43 -0
- {ucon-2.2.2 → ucon-2.4.0}/ucon/comprehensive.ucon.toml +325 -4
- {ucon-2.2.2 → ucon-2.4.0}/ucon/contexts.py +31 -2
- {ucon-2.2.2 → ucon-2.4.0}/ucon/conversion.py +325 -38
- {ucon-2.2.2 → ucon-2.4.0}/ucon/core/__init__.py +8 -0
- {ucon-2.2.2 → ucon-2.4.0}/ucon/core/_types.py +962 -23
- ucon-2.4.0/ucon/core/exceptions.py +409 -0
- {ucon-2.2.2 → ucon-2.4.0}/ucon/formulas/__init__.py +2 -0
- ucon-2.4.0/ucon/formulas/exceptions.py +107 -0
- {ucon-2.2.2 → ucon-2.4.0}/ucon/formulas/registry.py +123 -27
- {ucon-2.2.2 → ucon-2.4.0}/ucon/formulas/types.py +24 -1
- ucon-2.4.0/ucon/maps.py +1060 -0
- {ucon-2.2.2 → ucon-2.4.0}/ucon/packages.py +158 -4
- {ucon-2.2.2 → ucon-2.4.0}/ucon/parsing/formulas.py +3 -0
- {ucon-2.2.2 → ucon-2.4.0}/ucon/parsing/namespaces.py +4 -0
- {ucon-2.2.2 → ucon-2.4.0}/ucon/serialization.py +47 -16
- {ucon-2.2.2 → ucon-2.4.0}/ucon/units.pyi +2 -0
- {ucon-2.2.2 → ucon-2.4.0/ucon.egg-info}/PKG-INFO +1 -1
- {ucon-2.2.2 → ucon-2.4.0}/ucon.egg-info/scm_file_list.json +18 -0
- ucon-2.4.0/ucon.egg-info/scm_version.json +8 -0
- ucon-2.2.2/ucon/core/exceptions.py +0 -211
- ucon-2.2.2/ucon/formulas/exceptions.py +0 -60
- ucon-2.2.2/ucon/maps.py +0 -561
- ucon-2.2.2/ucon.egg-info/scm_version.json +0 -8
- {ucon-2.2.2 → ucon-2.4.0}/.github/workflows/downstream.yaml +0 -0
- {ucon-2.2.2 → ucon-2.4.0}/.github/workflows/publish.yaml +0 -0
- {ucon-2.2.2 → ucon-2.4.0}/.github/workflows/tests.yaml +0 -0
- {ucon-2.2.2 → ucon-2.4.0}/.gitignore +0 -0
- {ucon-2.2.2 → ucon-2.4.0}/.gitmodules +0 -0
- {ucon-2.2.2 → ucon-2.4.0}/LICENSE +0 -0
- {ucon-2.2.2 → ucon-2.4.0}/MANIFEST.in +0 -0
- {ucon-2.2.2 → ucon-2.4.0}/Makefile +0 -0
- {ucon-2.2.2 → ucon-2.4.0}/NOTICE +0 -0
- {ucon-2.2.2 → ucon-2.4.0}/README.md +0 -0
- {ucon-2.2.2 → ucon-2.4.0}/SECURITY.md +0 -0
- {ucon-2.2.2 → ucon-2.4.0}/SUPPORT.md +0 -0
- {ucon-2.2.2 → ucon-2.4.0}/mkdocs.yml +0 -0
- {ucon-2.2.2 → ucon-2.4.0}/netlify.toml +0 -0
- {ucon-2.2.2 → ucon-2.4.0}/pyproject.toml +0 -0
- {ucon-2.2.2 → ucon-2.4.0}/requirements.txt +0 -0
- {ucon-2.2.2 → ucon-2.4.0}/setup.cfg +0 -0
- {ucon-2.2.2 → ucon-2.4.0}/ucon/_active.py +0 -0
- {ucon-2.2.2 → ucon-2.4.0}/ucon/_algebra_cache.py +0 -0
- {ucon-2.2.2 → ucon-2.4.0}/ucon/_bootstrap.py +0 -0
- {ucon-2.2.2 → ucon-2.4.0}/ucon/aspects/forest.py +0 -0
- {ucon-2.2.2 → ucon-2.4.0}/ucon/aspects/resolution.py +0 -0
- {ucon-2.2.2 → ucon-2.4.0}/ucon/aspects/types.py +0 -0
- {ucon-2.2.2 → ucon-2.4.0}/ucon/basis/__init__.py +0 -0
- {ucon-2.2.2 → ucon-2.4.0}/ucon/basis/builtin.py +0 -0
- {ucon-2.2.2 → ucon-2.4.0}/ucon/basis/graph.py +0 -0
- {ucon-2.2.2 → ucon-2.4.0}/ucon/basis/ops.py +0 -0
- {ucon-2.2.2 → ucon-2.4.0}/ucon/basis/transforms.py +0 -0
- {ucon-2.2.2 → ucon-2.4.0}/ucon/basis/types.py +0 -0
- {ucon-2.2.2 → ucon-2.4.0}/ucon/basis/vector.py +0 -0
- {ucon-2.2.2 → ucon-2.4.0}/ucon/checking.py +0 -0
- {ucon-2.2.2 → ucon-2.4.0}/ucon/constants.py +0 -0
- {ucon-2.2.2 → ucon-2.4.0}/ucon/constants.pyi +0 -0
- {ucon-2.2.2 → ucon-2.4.0}/ucon/core/_parsing_graph.py +0 -0
- {ucon-2.2.2 → ucon-2.4.0}/ucon/dimension.py +0 -0
- {ucon-2.2.2 → ucon-2.4.0}/ucon/dimension.pyi +0 -0
- {ucon-2.2.2 → ucon-2.4.0}/ucon/expressions.py +0 -0
- {ucon-2.2.2 → ucon-2.4.0}/ucon/graph.py +0 -0
- {ucon-2.2.2 → ucon-2.4.0}/ucon/integrations/__init__.py +0 -0
- {ucon-2.2.2 → ucon-2.4.0}/ucon/integrations/numpy.py +0 -0
- {ucon-2.2.2 → ucon-2.4.0}/ucon/integrations/pandas.py +0 -0
- {ucon-2.2.2 → ucon-2.4.0}/ucon/integrations/polars.py +0 -0
- {ucon-2.2.2 → ucon-2.4.0}/ucon/integrations/pydantic.py +0 -0
- {ucon-2.2.2 → ucon-2.4.0}/ucon/kinds/__init__.py +0 -0
- {ucon-2.2.2 → ucon-2.4.0}/ucon/kinds/exceptions.py +0 -0
- {ucon-2.2.2 → ucon-2.4.0}/ucon/kinds/lattice.py +0 -0
- {ucon-2.2.2 → ucon-2.4.0}/ucon/kinds/types.py +0 -0
- {ucon-2.2.2 → ucon-2.4.0}/ucon/parsing/__init__.py +0 -0
- {ucon-2.2.2 → ucon-2.4.0}/ucon/parsing/aspects.py +0 -0
- {ucon-2.2.2 → ucon-2.4.0}/ucon/parsing/dimensions.py +0 -0
- {ucon-2.2.2 → ucon-2.4.0}/ucon/parsing/kinds.py +0 -0
- {ucon-2.2.2 → ucon-2.4.0}/ucon/parsing/lexer.py +0 -0
- {ucon-2.2.2 → ucon-2.4.0}/ucon/parsing/quantity.py +0 -0
- {ucon-2.2.2 → ucon-2.4.0}/ucon/parsing/units.py +0 -0
- {ucon-2.2.2 → ucon-2.4.0}/ucon/quantity.py +0 -0
- {ucon-2.2.2 → ucon-2.4.0}/ucon/resolver.py +0 -0
- {ucon-2.2.2 → ucon-2.4.0}/ucon/system/__init__.py +0 -0
- {ucon-2.2.2 → ucon-2.4.0}/ucon/units.py +0 -0
- {ucon-2.2.2 → ucon-2.4.0}/ucon.egg-info/SOURCES.txt +0 -0
- {ucon-2.2.2 → ucon-2.4.0}/ucon.egg-info/dependency_links.txt +0 -0
- {ucon-2.2.2 → ucon-2.4.0}/ucon.egg-info/requires.txt +0 -0
- {ucon-2.2.2 → ucon-2.4.0}/ucon.egg-info/top_level.txt +0 -0
- {ucon-2.2.2 → ucon-2.4.0}/uv.lock +0 -0
|
@@ -7,6 +7,597 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [2.4.0] - 2026-11-21
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- **The angle kinds, `plane_angle` and `solid_angle` (#348, #344).** `radian`,
|
|
15
|
+
`degree`, `gradian`, `turn`, `arcminute` and `arcsecond` declare
|
|
16
|
+
`default_kind = "plane_angle"`; `steradian` and `square_degree` declare
|
|
17
|
+
`solid_angle`. They are **two independent roots**, not siblings: the kinds
|
|
18
|
+
carry different dimensions and `KindLattice` rejects a cross-dimension parent
|
|
19
|
+
edge (`CrossDimensionParent`), so `lca` reports `DisjointKinds`. This
|
|
20
|
+
forecloses SI's `sr = rad²`, a *power* relation no parent edge expresses; it
|
|
21
|
+
waits on composing kinds and survives meanwhile only as the hand-squared
|
|
22
|
+
`square_degree → steradian` factor. Nothing new refuses — `rad → sr`,
|
|
23
|
+
`rad/s → Hz` and `W/m² → W/sr` raise what they raised before — the kinds are
|
|
24
|
+
insurance for ADR 013, which dissolves the `angle` pseudo-dimension at 3.0.0.
|
|
25
|
+
Of the cross-domain cases this insures `xdom-018` alone: `rad/s` is a
|
|
26
|
+
`UnitProduct` carrying no kind (needs #342, #343), and `W/m² → W/sr` refuses
|
|
27
|
+
on genuine SI signatures (`M·T⁻³` vs `M·L²·T⁻³`) with no tag involved.
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
- **`Number.to(..., kind=)` — the kind the caller claims the result is (#373,
|
|
31
|
+
#342, #343).** Default `None` leaves the arrival rule in charge, so every
|
|
32
|
+
existing call is unchanged. A claim is admitted only if *implied* by the kind
|
|
33
|
+
already carried — it restates that kind, or weakens it to an ancestor whose
|
|
34
|
+
`join_policy` permits generalizing. Strengthening a kind or exchanging it for
|
|
35
|
+
a sibling raises the new `KindClaimRefused`; a cross-fiber claim is taken as
|
|
36
|
+
given; `KindNotFound` for an unresolvable name.
|
|
37
|
+
|
|
38
|
+
This reaches errors no property of a unit can. *"Report 100 MPa of tensile
|
|
39
|
+
stress as a hydrostatic pressure"* converts `MPa → MPa`; `0.5 MJ/m³ → kPa` is
|
|
40
|
+
a legitimate modulus of resilience while `500 kJ/m³ → kPa` *as a stress* is
|
|
41
|
+
not, and unclaimed the two are one conversion returning `<500.0 kPa>`. Only
|
|
42
|
+
the claim separates them — which is why the product-signature `default_kind`
|
|
43
|
+
plan on #342/#343 could not.
|
|
44
|
+
|
|
45
|
+
- **An `energy_density` kind**, declared and attached to nothing. A second root
|
|
46
|
+
on `Dimension(pressure)` rather than a child of `pressure`: same dimension and
|
|
47
|
+
same derivation — `(N·m)/m³` reduces to `N/m²` — but a different quantity, so
|
|
48
|
+
`lca` reports `DisjointKinds` against the pressure family. `J/m³` carries no
|
|
49
|
+
`default_kind` deliberately, for the reason above.
|
|
50
|
+
|
|
51
|
+
- **`Number.to(..., aspect=)`, and the first aspect families in the catalog
|
|
52
|
+
(#343).** Closes the last two must-fails of UnitSafe's pressure cluster —
|
|
53
|
+
*"report dynamic pressure as static pressure"* and *"equate atmospheric with
|
|
54
|
+
lithostatic pressure"* — taking it to 6 of 6. Both convert a unit to itself
|
|
55
|
+
**and** carry the same kind on both sides, so neither a unit nor a kind could
|
|
56
|
+
reach them: what differs is an adjective.
|
|
57
|
+
|
|
58
|
+
`pressure_role` (`static_pressure`, `dynamic_pressure`) and `pressure_origin`
|
|
59
|
+
(`atmospheric_pressure`, `lithostatic_pressure`, `hydrostatic_pressure`) are
|
|
60
|
+
declared on `join_policy = "lca"` with `applies_to` naming the pressure kinds,
|
|
61
|
+
so a quantity with no kind cannot carry them. They are **not** kinds, and the
|
|
62
|
+
reason is a must-pass row: `P0 = P + ½ρV²` is static plus dynamic, kinds refuse
|
|
63
|
+
addition across disjoint members, so kind-ifying these would make Bernoulli's
|
|
64
|
+
equation refuse. As aspects the sum lifts to the family root — a total
|
|
65
|
+
pressure, role unspecified — while the relabel still refuses, because a claim
|
|
66
|
+
is gated on implication rather than on the join (#376). One declaration serves
|
|
67
|
+
both operations.
|
|
68
|
+
|
|
69
|
+
Claims resolve family-wise, so a value may carry a role and an origin at once
|
|
70
|
+
and a claim about one leaves the other alone. Unknown names propagate the
|
|
71
|
+
forest's own `AspectError`.
|
|
72
|
+
|
|
73
|
+
- **The graph cache now carries the aspect forest.** `ucon/_cache.py` serialized
|
|
74
|
+
the kind lattice and silently dropped aspects, so a declared forest existed
|
|
75
|
+
only under `UCON_NO_CACHE=1` — latent until this release, since no aspects were
|
|
76
|
+
declared. Encode, decode and a parent-first builder now mirror the kinds pass.
|
|
77
|
+
|
|
78
|
+
- **The surface power density kinds: `irradiance`, `radiative_forcing` and
|
|
79
|
+
`heat_flux` (#344).** Three ISO 80000-7 / IPCC quantities share `W/m²`, and
|
|
80
|
+
UnitSafe names the confusion directly — *"equate radiative forcing with heat
|
|
81
|
+
flux as physically identical quantities"* and *"report solar irradiance as
|
|
82
|
+
radiative forcing"*. Disjoint siblings under a refusing
|
|
83
|
+
`surface_power_density` root, the idiom the power, pressure and frequency
|
|
84
|
+
clusters already use, so a crossing refuses while every same-kind conversion
|
|
85
|
+
in the cluster still admits. Nothing attaches them: `W/m²` is a `UnitProduct`
|
|
86
|
+
and the unit genuinely does not say which quantity it carries, so the caller
|
|
87
|
+
states it with `Number.to(..., kind=)`.
|
|
88
|
+
|
|
89
|
+
This is the first kind in the catalog whose dimension is declared as an
|
|
90
|
+
**expression** (`"mass/time^3"`) rather than a registered name, since `W/m²`
|
|
91
|
+
reduces to M·T⁻³ and SI does not name it.
|
|
92
|
+
|
|
93
|
+
- **Clearance vs blood flow, and hydraulic head vs distance (#344).** Two more
|
|
94
|
+
of UnitSafe's unclustered `koq_mismatch` must-fails. `volumetric_flow_rate`
|
|
95
|
+
roots `clearance` and `blood_flow` (L³/T); `length_quantity` roots `distance`
|
|
96
|
+
and `hydraulic_head`. Both pairs fail the add-test — a total clearance is the
|
|
97
|
+
sum of *clearances*, never of a clearance and a flow, and a head and a
|
|
98
|
+
distance do not sum at all — so they are kinds rather than aspects.
|
|
99
|
+
|
|
100
|
+
Nothing attaches them. `meter` carries no `default_kind` and must not: most
|
|
101
|
+
lengths are plain distances, and tagging the unit would force a claim onto
|
|
102
|
+
every one of them. Every clearance must-pass in the benchmark is a same-kind
|
|
103
|
+
unit conversion and still admits.
|
|
104
|
+
|
|
105
|
+
`gfr` is **deliberately not** declared as a sibling of `clearance`: the
|
|
106
|
+
benchmark keys its GFR must-passes as `clearance`, so splitting them would
|
|
107
|
+
refuse a claim the dataset makes. Recorded as a test so the omission reads as
|
|
108
|
+
a decision rather than an oversight.
|
|
109
|
+
|
|
110
|
+
- **Weight basis and administration route as aspects (#344).** Two more
|
|
111
|
+
unclustered `koq_mismatch` must-fails: *"treat ideal body weight and actual
|
|
112
|
+
body weight as identical for dosing"* and *"equate oral morphine equivalent
|
|
113
|
+
dose with IV morphine equivalent dose"*. `body_weight_basis`
|
|
114
|
+
(`ideal_body_weight`, `actual_body_weight`) and `administration_route`
|
|
115
|
+
(`oral_route`, `intravenous_route`), both on `join_policy = "lca"`, with
|
|
116
|
+
`body_mass` and `drug_dose` declared as the kinds they attach to since `mass`
|
|
117
|
+
had none.
|
|
118
|
+
|
|
119
|
+
Aspects rather than kinds because the pair **sums**: a total opioid burden is
|
|
120
|
+
the sum across routes, which is the entire purpose of a morphine-equivalent
|
|
121
|
+
dose. `30 mg` oral plus `10 mg` IV now answers `<40 mg [drug_dose]
|
|
122
|
+
#administration_route>` — total dose, route unspecified — while relabelling
|
|
123
|
+
one route as the other refuses. Kind-ifying them would have broken the sum.
|
|
124
|
+
|
|
125
|
+
Nothing attaches them: a bare `kg` is neither a dose nor a body weight, and
|
|
126
|
+
still carries no kind or aspect.
|
|
127
|
+
|
|
128
|
+
- **Canonical `one`: the unity unit is named, and `"1"` resolves to it (#307).**
|
|
129
|
+
The catalog already declared a `Dimension(none)` unity unit, but with
|
|
130
|
+
`name = ""` — undiscoverable, so `"1"`, `"dimensionless"` and `"unitless"` had
|
|
131
|
+
been given to `fraction`, which carries `Dimension(ratio)`. The obvious
|
|
132
|
+
dimensionless literal therefore landed on the one fiber where a
|
|
133
|
+
`Dimension(none)` kind cannot attach, and
|
|
134
|
+
`Number(20, parse_unit('1'), kind=radiation_weighting_factor)` raised
|
|
135
|
+
`KindDimensionMismatch`. The unit is now `units.one` and those three aliases
|
|
136
|
+
resolve to it, so `Gy * w_R` answers `<40 Gy [dose_equivalent]>` with the
|
|
137
|
+
literal a caller would write.
|
|
138
|
+
|
|
139
|
+
`""` is kept as an alias deliberately: dimensionless *constants* are carried
|
|
140
|
+
by the empty-string unit name. `fraction` keeps `frac` and keeps
|
|
141
|
+
`Dimension(ratio)` — emptying the ratio fiber into `Scale` is 3.0.0's work.
|
|
142
|
+
|
|
143
|
+
- **Division dispatches kinds through its own table (#381).** `/` consulted the
|
|
144
|
+
formula registry with the same key `*` uses, so a formula declared for a
|
|
145
|
+
*product* answered the *quotient* — `Gy * w_R` is a dose equivalent and
|
|
146
|
+
`Gy / w_R` claimed to be one too. v2.3.0's #352 shipped the refusal half of
|
|
147
|
+
this (`Gy / Sv` stopped cancelling to `1.0`); this is the dispatch half.
|
|
148
|
+
|
|
149
|
+
**Operation is now part of a formula's identity.** `KindFormula` gains an
|
|
150
|
+
`operation` field — `Operation.MULTIPLY` (default) or `Operation.DIVIDE` — and
|
|
151
|
+
every registry index is keyed on it, so all four lookup tiers and the
|
|
152
|
+
collision guard became operation-aware together. `commutative` is unchanged
|
|
153
|
+
and remains a different axis: operand *order within* one operation.
|
|
154
|
+
|
|
155
|
+
This widens #347's guard, which read a product and a quotient over one input
|
|
156
|
+
tuple as a single signature — so the inverse declaration ADR 013 §4 names as
|
|
157
|
+
the route to a quotient kind was unregisterable. Both now register, each
|
|
158
|
+
answers only its own operation, and a collision *within* an operation still
|
|
159
|
+
refuses. Additive: formulas declared before this default to `MULTIPLY`.
|
|
160
|
+
|
|
161
|
+
- **A dimension-one unit that names a quantity survives a product (#318).**
|
|
162
|
+
`UnitProduct` dropped every `Dimension(none)` factor at construction, keeping
|
|
163
|
+
its *scale* and discarding the unit — so the scale survived without the thing
|
|
164
|
+
it scaled, and a money-rate unit could not be constructed, kinded, or carry a
|
|
165
|
+
declaration. `USD/kWh` rendered as `1/(kW·h)` and `100 kWh × 0.12 USD/kWh`
|
|
166
|
+
answered `<12.0>`; they are now `<UnitProduct USD/(kW·h)>` and `<12.0 USD>`.
|
|
167
|
+
|
|
168
|
+
The discriminator is **identity, not name**: #307 named the canonical unity
|
|
169
|
+
`one` in this same release, so "anonymous" stopped being a usable proxy for
|
|
170
|
+
"is the identity" — a first cut rendered `one * kg` as `one·kg`. Folding keys
|
|
171
|
+
on the unity itself, so `one * kg` is `kg` while `USD/h` keeps its symbol.
|
|
172
|
+
|
|
173
|
+
Four sites carried the same "dimensionless means unity" assumption: the
|
|
174
|
+
reduction path, both construction fast paths, and `Unit.shorthand`, which
|
|
175
|
+
blanked every `Dimension(none)` unit — making `USD` invisible on a bare
|
|
176
|
+
`Number` while a one-factor `UnitProduct` of the same unit rendered it.
|
|
177
|
+
|
|
178
|
+
This reverses a stated canonical-form invariant: "no dimensionless factor
|
|
179
|
+
survives" becomes "no *unity* factor survives". Six tests encoding the old
|
|
180
|
+
form are updated, each gaining a companion for the new rule. Magnitudes are
|
|
181
|
+
unchanged — a scaled symbol carries its scale on the surviving factor, a
|
|
182
|
+
scaled unity still folds into `canonical_scale`. Unblocks the money-rate
|
|
183
|
+
pattern ADR 011 reserves for fee schedules: `500 MWh × 48 USD/MWh` now
|
|
184
|
+
answers `<24000.0 USD [usd]>` in both operand orders, pinned as a test.
|
|
185
|
+
|
|
186
|
+
- **A kind on an unnamed derived dimension no longer breaks the TOML
|
|
187
|
+
round-trip.** `Dimension` renders a vector with no registered name as
|
|
188
|
+
`derived(mass/time^3)`, which is a *rendering*, not an identifier —
|
|
189
|
+
`parse_dimension` rejects it with *"Unknown dimension identifier 'derived'"*.
|
|
190
|
+
Both `_serialize_kind` and `_dimension_to_expression` treated it as a name and
|
|
191
|
+
emitted it verbatim, so any such kind failed to reload. The expression is now
|
|
192
|
+
rebuilt from the vector (`M/T^3`) whenever the name is a `derived(...)`
|
|
193
|
+
rendering. Latent until now, because no kind was declared on an unnamed
|
|
194
|
+
dimension.
|
|
195
|
+
|
|
196
|
+
### Documentation
|
|
197
|
+
|
|
198
|
+
- **Three roadmap corrections, all scheduling rather than scope.**
|
|
199
|
+
|
|
200
|
+
*`**` moves from v2.3.1 to v3.2.0.* The deferred-behaviour suite named the
|
|
201
|
+
contradiction: the bullet's own "Blocked by" line cites `DerivedKind` and a `**`
|
|
202
|
+
dispatch row as **v3.2.0** work, while "Fixed in" claimed v2.3.1 — three minor
|
|
203
|
+
releases ahead of its prerequisite. v3.2.0 already lists the dispatch row, so the
|
|
204
|
+
bullet now sits beside it.
|
|
205
|
+
|
|
206
|
+
The test docstring also records *why* it matters, since `kind is None` reads as
|
|
207
|
+
harmless: `**` launders the kind stratum.
|
|
208
|
+
`Gy[absorbed_dose] + Sv[dose_equivalent]` raises `JoinRefused`, while
|
|
209
|
+
`(Gy)**2 + (Sv)**2` answers `<13.0 Gy²>` — squaring two incommensurable
|
|
210
|
+
quantities makes them addable. And `None` is a false claim, not a missing one:
|
|
211
|
+
`Gy²` has a kind and lacks a *name*, as `m × m` is `derived(length^2)`.
|
|
212
|
+
|
|
213
|
+
*v2.6.0 and v3.0.0 decouple from the currency basis component (#292).* The
|
|
214
|
+
basis-component design rested on currency needing a guard that holds with no kind
|
|
215
|
+
lattice installed; #383 made that guard structural, since base-form signatures
|
|
216
|
+
carry the currency symbol. The v3.0.0 row now states the basis rename and shim
|
|
217
|
+
retirement on their own footing — `information` has held slot 8 since before
|
|
218
|
+
currency was proposed — with the slot-9 fold contingent on #292's review, and
|
|
219
|
+
v2.6.0 no longer asserts 3.0.0-prerequisite status.
|
|
220
|
+
|
|
221
|
+
|
|
222
|
+
|
|
223
|
+
- **A regression suite pinning the deferred behaviours**
|
|
224
|
+
(`tests/ucon/test_deferred_behaviours.py`). Eleven assertions record what
|
|
225
|
+
ucon does *today* where what it does is known-wrong, filed, and blocked
|
|
226
|
+
behind a release that has not happened: the `nines` scalar/additive
|
|
227
|
+
contradiction (#341), same-unit addition on points and levels (#340's
|
|
228
|
+
explicitly out-of-scope half, ADR 009 §3), `lm → cd` (#346), the
|
|
229
|
+
dimensionless kinds that cannot attach to `percent`/`fraction` (#344),
|
|
230
|
+
`rad² ↔ sr` and the idempotent tag algebra (#348), `Number` being
|
|
231
|
+
unhashable (#353, blocked on #362), `**` dropping the kind, and the
|
|
232
|
+
torque/energy and pressure/energy-density clusters converting freely
|
|
233
|
+
(#342, #343). Each test's docstring names the issue, the blocker and the
|
|
234
|
+
release that closes it, so changing one of these behaviours fails CI and
|
|
235
|
+
points the reader at the filed cause instead of inviting a re-diagnosis.
|
|
236
|
+
The file is not a specification of intent; it is the companion to
|
|
237
|
+
`tests/ucon/core/test_operator_stratum_grid.py` for behaviours that are
|
|
238
|
+
not cells of that grid.
|
|
239
|
+
|
|
240
|
+
|
|
241
|
+
- **The v2.4.0 roadmap row records that #342 and #343 moved to #373.** Both issues
|
|
242
|
+
prescribed `default_kind` on product signatures. Measurement against UnitSafe says
|
|
243
|
+
otherwise: four of cluster 7's six must-fails convert a unit to itself
|
|
244
|
+
(`MPa → MPa`), which no unit-keyed tag can reach, and tagging `J/m³` with
|
|
245
|
+
`energy_density` would fail the must-pass `0.5 MJ/m³ → kPa` — the same operation as
|
|
246
|
+
the must-fail `500 kJ/m³ → kPa`, differing only in the claim. A `kind=` argument on
|
|
247
|
+
`Number.to()` (#373) clears 12 of the 14 must-fails against the lattice as it
|
|
248
|
+
stands, since `join(torque, energy)` already refuses while `join(torque, torque)`
|
|
249
|
+
admits. Both issues keep their diagnoses and carry a comment pointing at #373.
|
|
250
|
+
|
|
251
|
+
## [2.3.0] - 2026-10-20
|
|
252
|
+
|
|
253
|
+
### Added
|
|
254
|
+
|
|
255
|
+
- **Ordering and the reflected operators on `Number` (#353).** `__lt__`,
|
|
256
|
+
`__le__`, `__gt__` and `__ge__` route through one three-way `_compare` and
|
|
257
|
+
agree with `__eq__` (same `1e-12` window), so `sorted`, `min` and `max` now
|
|
258
|
+
work and `units.meter(1) < units.foot(1)` is no longer a `TypeError`. A
|
|
259
|
+
dimension mismatch, a kind join the lattice refuses, and an aspect conflict
|
|
260
|
+
all refuse ordering exactly as `+` refuses them; the chart stratum does not,
|
|
261
|
+
since all three chart classes are monotone, so `3 dB < 10 dB` and
|
|
262
|
+
`20 °C < 25 °C` are well posed. A pair no algebraic factor relates still
|
|
263
|
+
needs `.to()` first — `celsius(20) < kelvin(300)` raises
|
|
264
|
+
`UnitsNotNormalizable`. `__ne__` is now defined rather than inherited. The
|
|
265
|
+
reflected `__rmul__`, `__radd__`, `__rsub__` and `__rtruediv__` each admit
|
|
266
|
+
exactly what their forward form admits, so `2 * units.meter(3)` answers
|
|
267
|
+
`<6 m>` and `2 / units.meter(4)` a reciprocal length, while `2 + a` and
|
|
268
|
+
`2 - a` stay `TypeError`. `__hash__` and `__floordiv__` stay absent — the
|
|
269
|
+
hash waits on `Number` being frozen (#362, sequenced at 3.0.0 by ADR 009).
|
|
270
|
+
|
|
271
|
+
- **`var`, the volt-ampere reactive (#345).** Completes the W/VA/var
|
|
272
|
+
degeneracy cluster: `reactive_power` was declared but unreachable, no unit
|
|
273
|
+
carrying it. `var` declares `default_kind = "reactive_power"`, resolves as
|
|
274
|
+
`var` / `VAr` / `volt_ampere_reactive`, takes SI prefixes (`kvar`), and
|
|
275
|
+
shares the coherent power `base_form` (`m²·kg·s⁻³`) with `watt` and
|
|
276
|
+
`volt_ampere`. All four cross-kind conversions in the cluster now refuse —
|
|
277
|
+
`W → var`, `var → W`, `var → VA`, `VA → var` — while same-kind arithmetic
|
|
278
|
+
and prefix scaling work. No conversion edge is declared: the refusal belongs
|
|
279
|
+
to the kind stratum, as `watt ↔ volt_ampere` already does. `var` is
|
|
280
|
+
unreachable by the `base_form` BFS oracle, so `make base-forms-check` does
|
|
281
|
+
not cover it.
|
|
282
|
+
|
|
283
|
+
- **`PolynomialMap`: calibration curves become expressible, with a
|
|
284
|
+
single-valued inverse (#331).** Real calibrations — Callendar–Van Dusen for
|
|
285
|
+
a platinum RTD, the NIST ITS-90 thermocouple references, a fitted load-cell
|
|
286
|
+
quadratic — are not compositions of the five existing maps.
|
|
287
|
+
`PolynomialMap(coefficients, domain, rel_uncertainty=0.0)` takes
|
|
288
|
+
coefficients in **ascending** order (`coefficients[i]` multiplies `x**i`),
|
|
289
|
+
matching the TOML `coefficients` key; composition with another polynomial or
|
|
290
|
+
with a linear/affine map folds into one `PolynomialMap`. `inverse()` returns
|
|
291
|
+
a `PolynomialInverseMap` — the single branch monotone on the declared
|
|
292
|
+
`domain`, so uncertainty transports as across any other edge. A polynomial
|
|
293
|
+
that turns inside its domain raises the new `NonMonotoneOnDomain` naming the
|
|
294
|
+
turning points rather than choosing a root; narrowing the domain to one side
|
|
295
|
+
restores the branch, and a critical point *on* a boundary is fine (`x²` over
|
|
296
|
+
`[0, 1]` inverts to the square root). Degree 1 inverts to an `AffineMap`;
|
|
297
|
+
degree 0 is not invertible. Both types round-trip through package TOML
|
|
298
|
+
(`type = "polynomial"`, `type = "polynomial_inverse"`) and the binary cache,
|
|
299
|
+
and `_CACHE_SCHEMA` is bumped to 4 — an older cache carries no tag for
|
|
300
|
+
either type. `Unit.chart` is untouched.
|
|
301
|
+
|
|
302
|
+
- **The KOQ floor: degeneracy-cluster units declare their kind (#327).** Where
|
|
303
|
+
the SI gives two units the same dimension to mark a kind distinction, those
|
|
304
|
+
units now carry a `default_kind`: `gray → absorbed_dose`,
|
|
305
|
+
`sievert → dose_equivalent`, `hertz → periodic_frequency`,
|
|
306
|
+
`becquerel → radioactive_activity`, `watt → real_power`,
|
|
307
|
+
`volt_ampere → apparent_power`. One kind is added, `periodic_frequency`.
|
|
308
|
+
With #322's refusing clause, `1 Gy → Sv`, `1 Bq → Hz` and `1 W → VA` refuse
|
|
309
|
+
across a static edge while a dated/contingent table still licenses a
|
|
310
|
+
re-kind. `joule` and `pascal` are left generic — no sibling SI unit
|
|
311
|
+
distinguishes work from heat or pressure from stress, so a Number stays free
|
|
312
|
+
to carry `kinetic_energy` or `mechanical_stress`; the torque/energy and
|
|
313
|
+
pressure/stress must-fails are the model's declared-kind responsibility
|
|
314
|
+
(ucon-tools#62).
|
|
315
|
+
|
|
316
|
+
- **The arrival rule — `.to()` re-kinds at a `default_kind` unit**
|
|
317
|
+
(#305, #322, #327). The second half of `Unit.default_kind`, whose
|
|
318
|
+
declaration shipped in #306; ADR 011 states the rule:
|
|
319
|
+
|
|
320
|
+
> the target's declared kind wins, **unless it is already an ancestor of the
|
|
321
|
+
> current kind**, in which case the finer kind survives — and when the two
|
|
322
|
+
> kinds are **siblings**, only an edge licensed by a contingent context may
|
|
323
|
+
> re-kind; a static edge **refuses**.
|
|
324
|
+
|
|
325
|
+
Narrowing is unlicensed on the same grounds as siblings: both relabel onto a
|
|
326
|
+
claim the value does not imply, so both refuse across a static edge with the
|
|
327
|
+
new `KindArrivalRefused` (exported from `ucon`). So
|
|
328
|
+
`Number(1, gray, kind=absorbed_dose).to(sievert)` refuses, a dated FX table
|
|
329
|
+
still re-kinds `usd → eur`, and conversion *within* a kind keeps the finer
|
|
330
|
+
label — 8 bits of `payload_size` are 1 byte of it. Across *different*
|
|
331
|
+
dimensions the conversion transformed the stuff (`E = h·f`), so the arrival
|
|
332
|
+
kind is adopted with no license, and converting to a unit that declares no
|
|
333
|
+
kind drops a kind that no longer fits the result's dimension. The new
|
|
334
|
+
`Graph.convert_with_license` returns the licensing context's name alongside
|
|
335
|
+
the map; `convert` is unchanged. Resolution is best-effort — an unknown
|
|
336
|
+
declared name leaves the kind untouched. Aspects are unaffected, and
|
|
337
|
+
`NumberArray` has no kind stratum (#297).
|
|
338
|
+
|
|
339
|
+
- **`ConversionContext.contingent` — dated tables no longer chain (#317).** A
|
|
340
|
+
context edge is either *definitional*, licensed by an exact constant, or
|
|
341
|
+
*contingent* — a dated table that could have been otherwise. The rule: a
|
|
342
|
+
path may draw on **at most one** contingent context. Composing a tariff
|
|
343
|
+
(`joule → USD`) with a rate table (`USD → EUR`) previously returned a euro
|
|
344
|
+
energy price nobody quoted; it now raises the new
|
|
345
|
+
`ContingentCompositionRefused`, which names both tables and is distinct from
|
|
346
|
+
`ConversionNotFound` because a declined path and an absent one are different
|
|
347
|
+
facts. `contingent` defaults to `False`, so nothing shipped changes —
|
|
348
|
+
`spectroscopy` and `boltzmann` are exact by SI and keep chaining.
|
|
349
|
+
Composition *within* one contingent context is permitted, which is what
|
|
350
|
+
ADR 011's star topology relies on: `EUR → GBP` resolves through USD from a
|
|
351
|
+
single table at a single date.
|
|
352
|
+
|
|
353
|
+
- **`[[contexts]]` in package TOML — conversion contexts ship as data
|
|
354
|
+
(#282).** `UnitPackage` had no `contexts` field, so a domain package could
|
|
355
|
+
not distribute a context even though graph-level TOML round-tripped one. A
|
|
356
|
+
package now declares `[[contexts]]` with nested `[[contexts.edges]]`, parsed
|
|
357
|
+
into the new `ContextDef` and exposed as `UnitPackage.contexts` —
|
|
358
|
+
array-of-tables with a `name`, matching every other package section rather
|
|
359
|
+
than graph TOML's keyed `[contexts.<name>]`. Context edges reuse `EdgeDef`,
|
|
360
|
+
so the `factor`/`offset` shorthand, explicit `map` specs, and
|
|
361
|
+
constant-licensed factor expressions (`factor = "k_d"`) all work.
|
|
362
|
+
`Graph.with_package` **registers** each context rather than inserting its
|
|
363
|
+
edges — loading the package makes the conversion available, and it applies
|
|
364
|
+
only while `using_context` has it active. Pre-existing limit, unchanged:
|
|
365
|
+
context edges resolve between plain units, not scaled or composite
|
|
366
|
+
endpoints, so `meter → hertz` resolves under a context, `nm → THz` does not.
|
|
367
|
+
|
|
368
|
+
- **`default_kind` on `Unit` — the first unit→kind association (#305).** A
|
|
369
|
+
unit may declare the `Kind` it measures when nothing says otherwise, via
|
|
370
|
+
`Unit(default_kind="...")` or a `default_kind` key on a `[[units]]` entry. A
|
|
371
|
+
`Number` built with no explicit `kind=` takes the declaration; an explicit
|
|
372
|
+
`kind=` always wins. Names resolve against a lattice at load time (local
|
|
373
|
+
before ambient, as `Constant.kind` already does) and are qualified by the
|
|
374
|
+
`namespace` rewriter, so a package may declare both a kind and the units
|
|
375
|
+
that name it; resolution is best-effort, leaving the Number unkinded rather
|
|
376
|
+
than raising on a name the active lattice does not know. Like `scalable`,
|
|
377
|
+
the field is metadata — excluded from `Unit` equality and hashing.
|
|
378
|
+
|
|
379
|
+
### Changed
|
|
380
|
+
|
|
381
|
+
- **Unit-declared kinds join unkinded operands permissively; explicit kinds
|
|
382
|
+
stay strict (#325).** A kind attached by `Unit.default_kind` is a default,
|
|
383
|
+
not an assertion. Under strict mode a default-kinded operand meeting an
|
|
384
|
+
unkinded one now inherits the default under `+`/`−` and drops it under
|
|
385
|
+
`×`/`÷`, silently — `1 Hz + 1 (1/s)` is one quantity written two ways, and
|
|
386
|
+
`1 Hz × 3 s` is a compound that declares nothing. A kind the caller attached
|
|
387
|
+
explicitly still raises `KindMismatch`. Provenance is derived, not stored: a
|
|
388
|
+
kind is a default iff it equals what the unit's own declaration resolves to.
|
|
389
|
+
Prerequisite for the KOQ floor's declarations — without it, every mixed
|
|
390
|
+
expression `hertz` appears in would have regressed.
|
|
391
|
+
|
|
392
|
+
### Fixed
|
|
393
|
+
|
|
394
|
+
- **Scalar `*` and `/` are gated on level-vs-gain, and the `base_form`
|
|
395
|
+
invariants are enforced (#340).** `Number.__mul__` and `__truediv__`
|
|
396
|
+
consulted no chart notion when the other operand was a scalar, so every
|
|
397
|
+
logarithmic and interval unit returned a wrong magnitude in silence —
|
|
398
|
+
`Number(10, units.decibel_watt) * 2` answered `<20 dBW>`, which is 100 W
|
|
399
|
+
where twice 10 W is 13.010 dBW. Scalar multiplication is repeated addition,
|
|
400
|
+
so it now answers to the **additive** rules: point + point and level + level
|
|
401
|
+
refuse with the new `ScalarArithmeticRefused`, while gain + gain admits, so
|
|
402
|
+
`2 × (3 dB)` is still the 6 dB cascade and `10 dB / 2` the geometric half.
|
|
403
|
+
The gate covers `a * 2`, `a / 2`, `2 * a` and `2 / a`; `a ** 2` is untouched
|
|
404
|
+
— repeated *multiplication* is a different rule. Nine shipped units refuse:
|
|
405
|
+
`celsius`, `fahrenheit`, `reaumur`, `decibel_watt`, `decibel_milliwatt`,
|
|
406
|
+
`decibel_volt`, `decibel_spl`, `pH` and `nines`, while `decibel`, `bel`,
|
|
407
|
+
`neper` and `rankine` (#339) keep scaling.
|
|
408
|
+
|
|
409
|
+
Two invariants stop being allowlists. `BaseForm.__post_init__` now enforces
|
|
410
|
+
a positive, finite prefactor and a non-empty tuple of `(Unit, exponent)`
|
|
411
|
+
pairs, where `prefactor=-1`, `nan`, `inf`, `0.0` and `factors=()` were all
|
|
412
|
+
accepted before. And `Unit._set_base_form` guarded only "already set", so
|
|
413
|
+
one call could turn `10 dBW + 1 W` into `<11.0 dBW>` with
|
|
414
|
+
`make base-forms-check` green; it is now refused on any unit whose declared
|
|
415
|
+
edges give it no `(prefactor, factors)` representation.
|
|
416
|
+
|
|
417
|
+
Both guards ask one new read-only query, `Graph.scale_class(unit)`,
|
|
418
|
+
returning `"ratio"`, `"gain"`, `"level"` or `"point"` — #356's rule read in
|
|
419
|
+
reverse, over a unit's whole multiplicative neighbourhood (product-edge
|
|
420
|
+
table included) rather than its own edges. A unit the graph declares no
|
|
421
|
+
edges for reads as a ratio scale, as do unanchored ratio scales such as
|
|
422
|
+
`radian` and `percent`. Verdicts are memoized per graph, cleared by
|
|
423
|
+
`add_edge`. Not closed here: `20 °C + 20 °C` still answers `<40 °C>`, since
|
|
424
|
+
`_require_normalizable` exempts same-unit operands.
|
|
425
|
+
|
|
426
|
+
- **Formula-signature collisions are refused at registration (#347).**
|
|
427
|
+
`FormulaRegistry.register` wrote its kind-identity indexes with
|
|
428
|
+
`setdefault`, so two formulas claiming one input signature with *different*
|
|
429
|
+
output kinds were both admitted and the kind the stratum read came down to
|
|
430
|
+
registration order — invisible to lookup, since the loser was erased before
|
|
431
|
+
any tier ran and the ancestor walk's `AmbiguousFormula` never saw it.
|
|
432
|
+
`register` now refuses the pair up front with the new `CollidingFormula`,
|
|
433
|
+
naming both formulas, the contested signature and the two output kinds, and
|
|
434
|
+
leaves the registry unmodified. One rule at the one ingestion site covers
|
|
435
|
+
the EXACT, COMMUTATIVE and GENERALIZED tiers, and so both `*` and `/`. Two
|
|
436
|
+
formulas that *agree* on `output_kind` remain admissible, first writer wins.
|
|
437
|
+
The DIMENSIONAL tier stays unguarded: it discards kind identity by
|
|
438
|
+
construction and is opt-in per call (`dimension_fallback=True`).
|
|
439
|
+
|
|
440
|
+
- **`==` and `!=` consult the aspect stratum (#353).** The aspect peer of the
|
|
441
|
+
kind hole #352 closed: two `Number(1, units.gray)` values carrying *sibling*
|
|
442
|
+
positions under one `Aspect` root compared `True` while `+`, `*` and `/` all
|
|
443
|
+
raised `AspectRefused`. `_resolve_eq_aspects` resolves on the multiplicative
|
|
444
|
+
rule and reports a refusal as *unequal* rather than raising, so `__eq__`
|
|
445
|
+
stays total. Comparison therefore refuses on conflict only, never on silence
|
|
446
|
+
— `gray(1)#dry == gray(1)` is still `True`. Ordering, which carries no
|
|
447
|
+
total-function obligation, raises `AspectRefused` for the pair instead.
|
|
448
|
+
|
|
449
|
+
- **`/` and `==` consult the kind stratum (#352).** `gray(1) / sievert(1)`
|
|
450
|
+
cancelled both kinds and answered a bare `<1.0>`, and
|
|
451
|
+
`gray(1) == sievert(1)` answered `True` — the claim `must-fail-011` exists
|
|
452
|
+
to block, reachable without ever calling `.to()`. `_resolve_truediv_kind`
|
|
453
|
+
consults the `FormulaRegistry` first, so a formula may name the quotient's
|
|
454
|
+
kind, and refuses with `FormulaNotFound` when the lattice refuses the join;
|
|
455
|
+
`_resolve_eq_kind` reports a refusal as *unequal* rather than raising,
|
|
456
|
+
keeping `__eq__` total and `!=` following by inheritance. So `W == VA`,
|
|
457
|
+
`Hz == Bq` and `Gy == Sv` are now `False` and `Gy / Sv` refuses, while
|
|
458
|
+
same-kind quotients, kinded-over-unkinded quotients, and kinds the lattice
|
|
459
|
+
*can* join stay anonymous ratios (`kind=None`). The operator × stratum
|
|
460
|
+
cross-product is now asserted cell-by-cell in
|
|
461
|
+
`tests/ucon/core/test_operator_stratum_grid.py`, so the next ungated
|
|
462
|
+
operator fails CI; the chart column's admissions are recorded as
|
|
463
|
+
expected-for-now, since chart dispatch lands in v3.2.0.
|
|
464
|
+
|
|
465
|
+
- **The `base_form` oracle no longer propagates across an offset, retiring the
|
|
466
|
+
hand-written allowlist.** `scripts/generate_base_forms.py` walked affine
|
|
467
|
+
edges by slope and ignored the offset, so it would mint `base_form = 1·K`
|
|
468
|
+
for `celsius`; a four-name list (`_NULL_BASE_FORM_NAMES`) suppressed that
|
|
469
|
+
after the fact, which is how `rankine` came to be suppressed in error. The
|
|
470
|
+
BFS now refuses to cross an offset-bearing affine edge exactly as it already
|
|
471
|
+
refuses a log/exp edge, so `celsius`/`fahrenheit`/`reaumur` are absent from
|
|
472
|
+
the expected map on their own and the list is empty. It survives as an empty
|
|
473
|
+
name because its *positive* assertion has no replacement: the oracle reaches
|
|
474
|
+
144 of 234 units, so inferring the null set from absence would reject
|
|
475
|
+
`tesla`, `weber`, `siemens`, `molar` and ~90 others.
|
|
476
|
+
|
|
477
|
+
- **`rankine` carries a `base_form` (#339).** It is a pure scaling of kelvin —
|
|
478
|
+
`0 °R = 0 K`, factor `5/9` — but was named in
|
|
479
|
+
`generate_base_forms._NULL_BASE_FORM_NAMES` beside the three
|
|
480
|
+
conventional-zero scales. Rankine is the absolute Fahrenheit-degree scale;
|
|
481
|
+
only the degree *size* is Fahrenheit's. Removing the name makes
|
|
482
|
+
`make base-forms-check` demand the value the generator's own BFS oracle
|
|
483
|
+
already derives, and the stored prefactor follows the v2.1.6/2.1.7
|
|
484
|
+
convention — compose exactly in `Fraction`, convert to float once — so the
|
|
485
|
+
regression test asserts equality with `float(Fraction(5, 9))` rather than a
|
|
486
|
+
tolerance. Two consequences: `units.rankine(20) + units.kelvin(5)` no longer
|
|
487
|
+
raises `UnitsNotNormalizable`, and `canonical_magnitude` / `to_base()` now
|
|
488
|
+
convert (`100/9 K`) instead of returning the raw quantity.
|
|
489
|
+
|
|
490
|
+
- **`contingent` now has a TOML key, so a packaged dated table arrives dated
|
|
491
|
+
(#329).** `ConversionContext.contingent` (#320) had no serialized
|
|
492
|
+
representation, so a context shipped in a package always loaded as
|
|
493
|
+
**definitional** and the composition guard never fired on it: a package
|
|
494
|
+
declaring a hub tariff (`joule → USD`) and euro reference rates
|
|
495
|
+
(`USD → EUR`), both `contingent = true`, resolved `1 GJ → EUR` silently. The
|
|
496
|
+
flag now survives `ContextDef` and `[[contexts]]` parsing,
|
|
497
|
+
`ContextDef.materialize`, `from_toml`, `to_toml` and the binary cache, and
|
|
498
|
+
`_CACHE_SCHEMA` is bumped to 3 — a stale cache missing the key would restore
|
|
499
|
+
`False` and reintroduce the defect. The default is unchanged: a context is
|
|
500
|
+
definitional unless it says otherwise.
|
|
501
|
+
|
|
502
|
+
### Documentation
|
|
503
|
+
|
|
504
|
+
- **`[Unreleased]` consolidated; the v2.3.0 roadmap row reads `Complete`.**
|
|
505
|
+
Nine interleaved section headers reduce to one each; #352 (#360) and #347
|
|
506
|
+
(#363) are marked shipped, and `__hash__` is stated as not in this release.
|
|
507
|
+
|
|
508
|
+
- **`ROADMAP.md` recast around the UnitSafe gate and re-scoped; ADR 013
|
|
509
|
+
proposed.** The roadmap is now ordered by what the UnitSafe benchmark
|
|
510
|
+
exercises rather than by principle, with a *The UnitSafe gate* section
|
|
511
|
+
recording what the benchmark does and does not reach here, and a *Where the
|
|
512
|
+
chart defects land* table replacing "angle becomes a real dimension" — angle
|
|
513
|
+
stays a quantity of dimension one, with `plane_angle` and `solid_angle` as
|
|
514
|
+
kinds. Thirteen issues surfaced working the chart stratum and the KOQ floor
|
|
515
|
+
(#339–#348, #352–#354) reduce to four root causes, the largest being the
|
|
516
|
+
pseudo-dimension tags; eight open issues are its consequences (#307, #318,
|
|
517
|
+
#321, #336, #341, #344, #346, #348).
|
|
518
|
+
[ADR 013](docs/internal/decisions/013-the-vector-is-the-only-carrier.md)
|
|
519
|
+
(*The vector is the only carrier*, Proposed) supplies the retirement v3.0.0
|
|
520
|
+
had named without content — dimensional identity in the basis vector, tags
|
|
521
|
+
absorbed or dissolved rather than deleted to `none`, currency a basis
|
|
522
|
+
component, `count` and the angle family as kinds on unity, linear ratios as
|
|
523
|
+
`Scale`, kinds composing through a normal form. It supersedes ADRs 005, 011
|
|
524
|
+
and 012, each cross-referenced, and the intended `%` API is specified by
|
|
525
|
+
example in
|
|
526
|
+
[proposals/percent-on-unity](docs/internal/proposals/percent-on-unity.md).
|
|
527
|
+
|
|
528
|
+
Where the releases now sit. **v2.3.0** is *stratum wiring and invariant
|
|
529
|
+
enforcement* — the three routes by which the kind stratum could be bypassed
|
|
530
|
+
(#340, #352, #353) and the invariants that were allowlists (#340, #347) —
|
|
531
|
+
with `rankine` (#339) and `var` (#345) landed against it. **v2.3.1** is
|
|
532
|
+
*Unity and the dimensionless fold* (#307, #318). The deprecation ladder,
|
|
533
|
+
3.0.0's only true prerequisite, moves forward to v2.4.0/v2.5.0. The KOQ
|
|
534
|
+
catalog floor **splits**: the angle clusters and the product-signature
|
|
535
|
+
`default_kind` mechanism become v2.4.0 (#342, #343, #344's angle half,
|
|
536
|
+
#348's kind half), and the half that needs the merged fiber becomes v3.1.0
|
|
537
|
+
(#341, #346, the remaining dimensionless kinds, `sr = rad²`). The Turnstile
|
|
538
|
+
moves to v3.2.0. Array parity (#297, #298) is the one row found *not* to be
|
|
539
|
+
a prerequisite and is left unsequenced; **#292 currency is** one — no
|
|
540
|
+
`currency` dimension or unit exists today and the SI basis still carries
|
|
541
|
+
`information` in slot 8 — as is part of the KOQ floor, since `xdom-018`,
|
|
542
|
+
`xdom-020` and `pr-028` refuse today *only* because the tags differ.
|
|
543
|
+
|
|
544
|
+
- **`Unit.chart` withdrawn: the catalog already declares the chart class**
|
|
545
|
+
(#336, with #339, #340 and #341 filed alongside). The proposal under
|
|
546
|
+
[`proposals/declared-unit-chart`](docs/internal/proposals/declared-unit-chart.md)
|
|
547
|
+
is withdrawn and **no field ships** — no TOML key, no `to_toml` emission, no
|
|
548
|
+
`_CACHE_SCHEMA` bump, no dataclass field, no hand-written declarations. The
|
|
549
|
+
class is derivable from the declared edge vocabulary: a unit's numerals are
|
|
550
|
+
a logarithm iff it is the source of an `exp` edge or the target of a `log`
|
|
551
|
+
edge, and origin classes are the components under pure-scaling edges; add
|
|
552
|
+
one physical fact — thermodynamic temperature has an absolute zero, realised
|
|
553
|
+
by `kelvin` — and the census of all 234 units falls out as **222 ratio / 3
|
|
554
|
+
interval / 9 logarithmic** with zero disagreements. The proposed fourth
|
|
555
|
+
`transformed` class is **declined**: addition on the `nines` chart has
|
|
556
|
+
exactly one meaning, the parallel-redundancy law, so `nines` is
|
|
557
|
+
`logarithmic`, and `PolynomialMap` is a cross-dimensional edge rather than a
|
|
558
|
+
numeral scheme. `logarithmic` needs no parameters either — `reference` is
|
|
559
|
+
already a populated field on `LogMap`/`ExpMap`, and the field-vs-power
|
|
560
|
+
distinction is already carried by `scale`.
|
|
561
|
+
|
|
562
|
+
[ADR 010](docs/internal/decisions/010-chart-nomenclature.md) and
|
|
563
|
+
[ADR 009](docs/internal/decisions/009-turnstile.md) §4 are **amended in
|
|
564
|
+
place** per the house convention: ADR 010's naming Decision stands, but the
|
|
565
|
+
one Consequences bullet forbidding the class to be read from a `Map`'s
|
|
566
|
+
algebraic form is withdrawn (both original bans — never from `base_form`,
|
|
567
|
+
never from an arbitrary sibling edge — stand), its Context claim that v2.2.0
|
|
568
|
+
shipped a declared field is marked counterfactual, and 009 §4's two `[live]`
|
|
569
|
+
cases are withdrawn as failing on re-test. **The 2.2.2 re-key reverses**:
|
|
570
|
+
the 62 same-fiber pairs over 34 units it would have unblocked are *correct*
|
|
571
|
+
refusals with a misleading message, since `base_form` is load-bearing for
|
|
572
|
+
the arithmetic and not only for the meaningfulness check — admitting
|
|
573
|
+
`50 % + 1 fraction` would yield `51 %` where the answer is `150 %`. Those
|
|
574
|
+
pairs are unblocked by #283, ADR 013's retirement and #339, not by relaxing
|
|
575
|
+
the gate. `ROADMAP.md` is brought into line.
|
|
576
|
+
|
|
577
|
+
- **ADR 012 — what "dimensionless" means.** The v3.0.0 pseudo-dimension
|
|
578
|
+
retirement is named in the roadmap as "degree et al. become first-class", a
|
|
579
|
+
phrase that admits two readings with opposite consequences. ADR 012 records
|
|
580
|
+
the decision required — *does a named dimensionless unit remain a
|
|
581
|
+
distinguishable symbol in the unit algebra, or is it unity?* — with both
|
|
582
|
+
options costed, plus a third that resolves per family, since `radian²` has a
|
|
583
|
+
correct target (steradian) while `count²` has none. Proposed, not accepted.
|
|
584
|
+
Three open issues are symptoms of the same gap: `Dimension(none)` factors
|
|
585
|
+
are dropped from `UnitProduct` at construction while pseudo-dimensions
|
|
586
|
+
survive (#318), `parse_unit("1")` yields `ratio` where a formula wants
|
|
587
|
+
`none` (#307), and pseudo-dimensional units cannot normalize so comparison
|
|
588
|
+
refuses across them (#313). The ADR separates three families that
|
|
589
|
+
"dimensionless" bundles — exact-factor (`percent`, `degree`, `steradian`),
|
|
590
|
+
no-relation (owned by `⊤_d` at the kind stratum) and non-multiplicative
|
|
591
|
+
(`decibel`, owned by the chart stratum) — of which today's
|
|
592
|
+
`Dimension(ratio)` holds the first and third at once. It also records a
|
|
593
|
+
sequencing hazard: `Dimension(count)` ships seven units and no count kinds,
|
|
594
|
+
so giving them a canonical scale before populating that lattice would turn
|
|
595
|
+
today's refusal of `flop/s + Hz` into a silent admission. Money is assessed
|
|
596
|
+
as `Dimension(count)`, which currency will ship on **without a compatibility
|
|
597
|
+
claim across v3.0.0**; ADR 011 gains a pointer, since it chose
|
|
598
|
+
"dimensionless" for currency before the factor-dropping behaviour was known
|
|
599
|
+
— the first thing #292 must settle.
|
|
600
|
+
|
|
10
601
|
## [2.2.2] - 2026-09-18
|
|
11
602
|
|
|
12
603
|
### Fixed
|