Model/backend/documents_parser
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
..
handler address JTK review comments 2026-04-20 15:11:17 +00:00
tests Model a PasHub dwelling's second main heating system 🟩 2026-07-24 15:45:47 +00:00
__init__.py Map to RdSapSiteNotes from site notes JSON 🟥 2026-04-16 13:54:03 +00:00
db_writer.py include updating epc_property_data to pashub to ara workflow 2026-04-29 09:55:14 +00:00
elmhurst_extractor.py fix(ventilation): read Blower Door AP50 pressure test (Summary) 2026-06-16 23:18:17 +00:00
extractor.py Model a PasHub dwelling's second main heating system 🟩 2026-07-24 15:45:47 +00:00
local_runner.py update local runner to work for elmhurst 2026-04-24 14:01:36 +00:00
parser.py Persist resolved UPRN on PasHub site-notes rows (#1537) 2026-07-10 13:19:28 +00:00
pdf.py update local runner to work for elmhurst 2026-04-24 14:01:36 +00:00