Reduction and aggregation operators lead their names, and five measurement-destination loci are registered - #34
Merged
Conversation
…its leading seat The two aggregation tokens now render one canonical spelling per quantity, leading and joiner-free, like the flux-surface-average family. root_mean_square joins BARE_PREFIX_OPERATORS, which makes it a precedence-30 domain reduction: its operand is the whole projected, qualified quantity, so it leads and drops the _of_ joiner (root_mean_square_wave_current_of_antenna_strap). The unary _of_ peel now carries the bare flag for reduction-class operators, so an _of_-authored spelling (root_mean_square_of_wave_current_of_antenna_strap) shares one representation with the bare form and renders to it; strict admits exactly the bare spelling. accumulated stays a qualifier in the intermediate representation - none of the sixteen accepted names changes what the token is - but the renderer no longer relocates the accumulation family (accumulated, cumulative, cumulative_inside_flux_surface) between the base and a trailing locus. It keeps its leading seat, so neutral_count_accumulated_at_wall converges to accumulated_neutral_count_at_wall. normalized, perturbed and change_in keep their existing placement.
Add reflectometer_cutoff_position, charge_exchange_channel, thomson_scattering_channel_position, langmuir_probe_position and calorimetry_component to the locus registry as position-typed tokens carrying the of and at relations, so a quantity whose instrument is known evaluates at that instrument's sampling location instead of the generic measurement_position locus. Each token is distinct from the existing hardware-entity token of the same instrument (langmuir_probe, ece-style channel entities are the channel object, not the sampled place). Redefine measurement_position in place to state what the location is: the position in the cylindrical frame at which a diagnostic channel samples, used for the coordinates of that position where the coordinate serves many instrument families. Type and relations are unchanged. Regenerate grammar model_types.py so the strict validation path resolves the new position tokens.
Registers the destination loci that let a diagnostic quantity name where it was measured instead of collapsing onto one generic measurement position, so a Doppler reflectometer, a Langmuir probe and an ECE channel each name their own locus.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Three grammar rulings, each landed with its own test coverage, plus the locus registrations the last of them needs.
What changed
A domain reduction leads its name and wraps the projection. Every spelling of a reduced quantity now shares one intermediate representation, so
toroidal_flux_surface_averaged_current_densityandflux_surface_averaged_toroidal_current_densityno longer denote the same quantity under two names — the second is canonical and the first is refused.An aggregation token leads its name joiner-free.
root_mean_squarejoins the bare-prefix operators andaccumulatedkeeps its leading seat, soaccumulated_radiated_energy_due_to_impurity_radiationis canonical rather thanradiated_energy_accumulated_due_to_impurity_radiation.Five diagnostic measurement-destination loci are registered. A quantity measured by a specific instrument can now name where it was measured instead of collapsing onto one generic measurement position, so a Doppler reflectometer, a Langmuir probe and an ECE channel each carry their own locus. The locus registry moves from 181 to 186 entries and the generated model types follow.
Measured effect on a live catalog
Parsing and re-composing 2348 accepted standard names against this grammar in a fresh interpreter:
The zero is the load-bearing number: there is no name this grammar accepts and then renders under a different spelling, so parser and renderer agree on everything they admit. The 26 refusals are names still carrying a pre-ruling spelling, and they fall into exactly two families with no unexpected shapes — 23 in the reduction and aggregation re-render cohort, every pair carrying an identical intermediate representation and therefore a re-rendering rather than a change of meaning, and 3 carrying a safety-factor locus in a non-absolute form whose absolute-form successors already exist.
Compatibility
A consumer holding one of the 23 affected spellings will find it refused rather than silently reinterpreted, which is why this is proposed as a minor rather than a patch release: the previous grammar releases in this series were additive, and this one reverses the canonical position of an operator family.