Model/datatypes/epc/domain
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
..
tests Close the #1639 residual PasHub LRHA WAVE 3 mapper blocks 🟩 2026-07-24 12:43:19 +00:00
__init__.py fix broken imports and rename mapper class 2026-04-13 16:36:13 +00:00
epc.py Band a continuous SAP score on its published rating 🟩 2026-07-21 10:07:55 +00:00
epc_codes.csv slice 8a: window physics and orientation aggregates 2026-05-16 15:32:45 +00:00
epc_property_data.py Int-code the surveyed window orientation to its SAP10 octant code 🟩 2026-07-15 08:48:36 +00:00
field_mappings.py Gate community-heated dwellings from HHRSH recommendation 🟥 2026-07-01 14:13:57 +00:00
historic_epc.py demo generated for use in address2uprn 2026-05-08 14:48:15 +00:00
historic_epc_matching.py Map shard rows to HistoricEpc field-by-field so every column is pyright-checked 🟩 2026-07-04 14:58:09 +00:00
mapper.py Model a PasHub dwelling's second main heating system 🟩 2026-07-24 15:45:47 +00:00