Model/datatypes
Khalim Conn-Kowlessar 22520becb9 Model a PasHub dwelling's second main heating system 🟩
A dwelling with two main heating systems lodges a "Main Heating 2" block and a
"Percentage of space heating provided by Main Heating 1" split (e.g. 20% fan +
80% slimline storage, or 50% storage + 50% panel heaters). The survey model held
a single `main_heating`, and the extractor read the whole §Heating section
first-match — so it captured only Main 1, modelled it as 100% of the load, and
dropped Main 2 and the split (also bleeding Main 2's fields into Main 1). Every
such dwelling over-rated.

- `HeatingAndHotWater` now holds `main_heating_2` + `main_heating_1_percent`.
- The extractor slices the "Main Heating Systems" region per system on the
  "Main Heating N" markers and reads Main 1's percentage; a single-main dwelling
  (no "Main Heating 2") parses byte-identically to before.
- `_map_sap_heating` factors the per-system detail into `_pashub_main_heating_
  detail(main, fraction)` and emits two `MainHeatingDetail`s, setting Main 2's
  `main_heating_fraction = 100 - Main 1 %` (the calculator reads Main 2's share
  and gives Main 1 the remainder).

5 of the 6 dual-main dwellings converge (within-0.5 53.4% → 55.3%, MAE 0.799);
single-main fixtures and the gov-API / Elmhurst / Guinness / Wythenshawe corpora
are unaffected. The 6th (497655371974, storage+panel) regresses because the
calculator deliberately bills an electric Main 2 at Main 1's rate
(`_main_2_space_heating_fuel_cost_gbp_per_kwh`, deferred §10a off-peak slice) —
the correct two-main mapping now exposes that calculator gap; tracked separately.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-24 15:45:47 +00:00
..
epc Model a PasHub dwelling's second main heating system 🟩 2026-07-24 15:45:47 +00:00
__init__.py further breaking up code 2023-07-20 12:24:34 +01:00
address_match.py refactor(address2uprn): name the match/decision return types; rename helper 2026-07-07 16:00:00 +00:00
datatypes.py further breaking up code 2023-07-20 12:24:34 +01:00
enums.py completed build of new demo portfolio - some fixed required still 2023-11-20 14:42:16 +00:00