mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-07-12 13:29:04 +00:00
`_secondary_fraction` keyed "has a secondary" off the integer `secondary_heating_type` code. The gov-API path surfaces the secondary as a DESCRIPTION instead (`secondary_heating.description`, e.g. "Portable electric heaters (assumed)") and leaves the integer code None. So a gas/oil boiler main (not in the §A.2.2 forced-secondary set) with an assumed portable-electric secondary dropped the secondary entirely (sec_kWh=0), under-costing the dwelling and over-rating its SAP. Per RdSAP §A.2.2 / SAP 10.2 Table 11, a lodged secondary is costed at its Table 11 fraction (cat-2 boiler = 0.10, billed at standard-rate electricity per the §A.2.2 assumed portable-electric default). New `_has_lodged_secondary_description` treats a real `secondary_heating.description` as a lodged secondary; passed to `_secondary_fraction` at both call sites. The description is authoritative — same lesson as floor_heat_loss / roof codes. (Electric-storage mains were unaffected: they force the secondary already.) Also adds the Table 11 fraction for main_heating_category=8 (electric underfloor, "Integrated storage/direct-acting electric systems" = 0.10) — the strict-raise surfaced this latent gap once cat-8 mains were routed through the lookup. Eval: 909 computed, 0 raises, 46.9% -> 47.6% within 0.5 (+13 certs: 420 -> 433), mean|err| 1.633 -> 1.586. 13 improved / 1 regressed (2610, a cat-10 room-heater cert with an independent over-count). Bucket "Portable electric heaters" median +2.73 -> ~0 on the gas/cat-2 subset (cat-7 storage was already correct). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| addresses | ||
| data_transformation | ||
| epc | ||
| fuel_rates | ||
| geospatial | ||
| property | ||
| property_baseline | ||
| sap10_calculator | ||
| sap10_ml | ||
| tasks | ||
| postcode.py | ||