Skip to content

Carry the steradian in the name, not only in the unit - #30

Merged
Simon-McIntosh merged 2 commits into
iterorganization:mainfrom
Simon-McIntosh:main
Sep 4, 2026
Merged

Carry the steradian in the name, not only in the unit#30
Simon-McIntosh merged 2 commits into
iterorganization:mainfrom
Simon-McIntosh:main

Conversation

@Simon-McIntosh

Copy link
Copy Markdown
Collaborator

Summary

  • Registers per_solid_angle as a dimension-transforming unary postfix operator, so a quantity resolved per unit solid angle (e.g. hard_xray_source_rate_per_solid_angle) carries the steradian in the name rather than only in the unit string.
  • Applies to any emitted-quantity base (source_rate, radiance, energy_source_rate, …) without adding a compound base, keeping the closed base vocabulary irreducible.
  • Adds per_steradian to the advisory aliases so a candidate spelling that names the unit is redirected to the registered operator spelling.
  • Regenerates the grammar modules (operators 50 → 51); physical bases and the base-kind digest are unchanged.

Test plan

  • uv run pytest tests/grammar/test_solid_angle_normalization.py tests/grammar/test_advisory_alias_contract.py

A volumetric emission rate resolved into direction is m^-3.s^-1.sr^-1, and no
segment, qualifier or operator meant per unit solid angle. Every candidate
spelling raised UnknownBaseTokenError, so the only name that parsed was the one
that discarded the steradian and left the unit string as the sole place the
per-solid-angle character survived.

Register per_solid_angle as a dimension-transforming unary_postfix operator.
Postfix because the division reads after the quantity it divides, as it does in
physics prose, and it renders hard_xray_source_rate_per_solid_angle directly.
One operator token serves every emitted quantity, where a base would need one
entry per species: source_rate, radiance and energy_source_rate all take it and
all round-trip. dimension_transforming suppresses the base-implies-unit
inference, which is invalid once sr^-1 joins the unit.

The token is deliberately NOT a base. source_rate is already registered, so a
source_rate_per_solid_angle base would be the compound-base shape the
irreducibility rule forbids; the mass_flow_rate precedent turned on flow_rate
being unregistered, which does not hold here.

per_steradian joins the advisory aliases so a retry that names the unit rather
than the quantity is offered the registered spelling.

Operators go from 50 to 51 and the generated grammar modules move with them.
Physical bases stay at 176, the closed base vocabulary stays at 211 tokens, and
the base-kind digest is unchanged, because nothing entered the base registry.
@Simon-McIntosh
Simon-McIntosh merged commit 3a603ef into iterorganization:main Sep 4, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant