mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-07-27 23:35:01 +00:00
The gov-EPC API lodges a two-main dwelling's main_heating_fraction pair in two incompatible encodings — a decimal fraction summing to ~1.0 ([0.8, 0.2]) or an integer percent summing to ~100 ([80, 20]) — while every consumer divides by 100 unconditionally. A decimal pair therefore collapsed the second main's share to ~1% of its true value, billing almost the whole load to the first system's fuel/efficiency. Normalise once at the mapper via a shared pair-sum discriminator (_normalised_main_heating_fraction): a genuine two-main split summing nearer 1.0 than 100 is scaled to percent; a percent pair and any single main are left exactly as lodged, so the 3 percent-encoded corpus certs do not regress. Wired across the seven from_rdsap_schema_* branches and the SAP-17.1 path, whose old int(fraction) floor silently deleted a decimal-lodged second main (int(0.35)=0). Spec: RdSAP 10 item 7-5 (percent is canonical), p.81. Corpus: within-0.5 80.3% -> 80.6%, MAE 0.584 -> 0.578. Example cert 10070086972 17.59 -> 18.73 (toward lodged 18). Closes #1666. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| abri | ||
| applications | ||
| backend | ||
| datatypes | ||
| domain | ||
| e2e | ||
| fixtures | ||
| harness | ||
| infrastructure | ||
| lambdas | ||
| magic_plan | ||
| orchestration | ||
| repositories | ||
| scripts | ||
| utilities | ||
| utils | ||
| __init__.py | ||
| conftest.py | ||
| test_lambda_packaging.py | ||