Model/domain/sap10_ml
Khalim Conn-Kowlessar a7990edb8c robustness: strict-raise on unmapped glazing + heating/HW efficiency codes
Forcing-function guards so a lodged-but-unmapped code surfaces loudly instead
of silently taking a wrong-but-plausible default (the class that hid single
glazing as U=2.5 until this session). Four silent fallbacks converted to raise
on PRESENT-but-unmapped codes, while keeping the legitimate ABSENT (None)
defaults:

- _api_glazing_transmission: unmapped glazing_type -> UnmappedApiCode (was
  None -> u_window all-None default 2.5).
- _api_cascade_glazing_type: unmapped glazing_type -> UnmappedApiCode (was
  pass-through -> wrong g-value slot).
- seasonal_efficiency: a lodged code/category resolving in neither
  _SPACE_EFF_BY_CODE nor the category/room-heater fallbacks -> UnmappedSapCode
  (was blind 0.80 gas-boiler default, which 'catastrophically misrates heat
  pumps and storage' per the table comment). Data-free calls keep 0.80.
- water_heating_efficiency: WHC in no SAP 10.2 Table 4a HW row ->
  UnmappedSapCode (was blind 0.78). Absent code keeps 0.78.

Zero current-corpus impact (909 computed / 0 raises, 56.66% within-0.5
unchanged) — the code/efficiency tables are complete for today's data, so
these are guards for the ongoing audit + future data refreshes. Verified the
WHC table already covers 908 (multi-point gas) and 950 (HW heat network), so
those are NOT unmapped-code bugs. 8 AAA tests, goldens + gate green, pyright
net-zero.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-09 13:21:13 +00:00
..
tests robustness: strict-raise on unmapped glazing + heating/HW efficiency codes 2026-06-09 13:21:13 +00:00
__init__.py refactor: lift-and-shift packages/domain/src/domain/ml → domain/sap10_ml 2026-05-26 13:01:35 +00:00
demand.py refactor: lift-and-shift packages/domain/src/domain/ml → domain/sap10_ml 2026-05-26 13:01:35 +00:00
ecf.py refactor: lift-and-shift packages/domain/src/domain/ml → domain/sap10_ml 2026-05-26 13:01:35 +00:00
envelope.py refactor: lift-and-shift packages/domain/src/domain/ml → domain/sap10_ml 2026-05-26 13:01:35 +00:00
rdsap_uvalues.py fix(roof-U): flat roof, undetermined thickness, "no/limited insulation" → Table 18 age default 2026-06-08 19:26:03 +00:00
sap_efficiencies.py robustness: strict-raise on unmapped glazing + heating/HW efficiency codes 2026-06-09 13:21:13 +00:00
schema.py refactor: lift-and-shift packages/domain/src/domain/ml → domain/sap10_ml 2026-05-26 13:01:35 +00:00
transform.py refactor: lift-and-shift packages/domain/src/domain/ml → domain/sap10_ml 2026-05-26 13:01:35 +00:00
ucl.py refactor: lift-and-shift packages/domain/src/domain/ml → domain/sap10_ml 2026-05-26 13:01:35 +00:00
ventilation.py refactor: lift-and-shift packages/domain/src/domain/ml → domain/sap10_ml 2026-05-26 13:01:35 +00:00