Skip to content

Remove technical parameter values from .nhd files (#217)#652

Open
zaucker wants to merge 1 commit into
oposs:mainfrom
zaucker:cleanup/issue-217-technical-values
Open

Remove technical parameter values from .nhd files (#217)#652
zaucker wants to merge 1 commit into
oposs:mainfrom
zaucker:cleanup/issue-217-technical-values

Conversation

@zaucker

@zaucker zaucker commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Closes #217.

Technical parameter values are now sourced exclusively from technical.cfg. The redundant value = X lines in the *** technical *** sections of the .nhd model files were stale and have been removed (1069 lines across v6.5.2 + v7.0.0).

Changes

To make the cfg the single source of truth:

  • Environment now carries one technical hash (the cfg values); the old .nhd fallback (technical-override // technical) is gone. A lookup of a parameter with no value now dies loudly, naming the parameter and module, instead of silently returning an undefined value. Environment gained a taxonomy attribute for that message.
  • Model::Technical TWEAK only coerces value when one is present, so a parameter declaration may legitimately have no value.
  • The 18 v7.0.0 parameters that were only defined in .nhd are moved into share/Models/version7.0.0/technical.cfg (v6.5.2 had none).
  • All value = lines stripped from the .nhd files (declarations — name/units/description — are kept).

Test fixtures that relied on the removed fallback now ship a technical.cfg and load it, mirroring production. Adds t/technical-missing.rakutest covering the die guard.

Verification

  • Full unit suite green: 547 tests (544 baseline + 3 new).
  • Model outputs proven byte-identical to main for Base + Kantonal_LU on both versions (diffed a numeric dump of ~5660 output values from this branch vs a pristine main worktree).

Note for reviewers

Output-equality and die-coverage were verified for Base + Kantonal_LU only. The strip removes values for all variants, so an .nhd-only parameter live only in some other variant would now die. The known Single_old ones (er_App_cattle_liquid / er_App_pigs_liquid) are among the 18 moved, but a full all-variant scan was not performed.

🤖 Generated with Claude Code

Technical parameter values are now sourced exclusively from technical.cfg.
The redundant `value = X` lines in the `*** technical ***` sections of the
.nhd model files were stale and are removed (1069 lines across v6.5.2 + v7.0.0).

To make the cfg the single source of truth:

- Environment now carries one `technical` hash (the cfg values); the old
  `.nhd` fallback (`technical-override // technical`) is gone. A lookup of a
  parameter with no value now dies loudly, naming the parameter and module,
  instead of silently returning an undefined value. Environment gained a
  `taxonomy` attribute for that message.
- Model::Technical's TWEAK only coerces `value` when one is present, so a
  parameter declaration may legitimately have no value.
- The 18 v7.0.0 parameters that were only defined in .nhd are moved into
  share/Models/version7.0.0/technical.cfg (v6.5.2 had none).

Test fixtures that relied on the removed fallback now ship a technical.cfg and
load it, mirroring production. Adds t/technical-missing.rakutest covering the
die guard.

Verified: full unit suite green (547 tests); model outputs are byte-identical
to main for Base + Kantonal_LU on both versions.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.

Remove value of technical parameters in nhd files

1 participant