Model/datatypes/epc
Khalim Conn-Kowlessar 353303168d Slice S0380.54: Elmhurst §14.1 Main Heating2 extraction + 2nd MainHeatingDetail
Cert 000565 lodges §14.1 Main Heating2 as PCDB 15100 (Vaillant Ecotec
plus 415, 88%, mains gas, 0% space heat) — this is the system that
services DHW via `Water Heating SapCode 914` ("from second main
system"). The previous extractor / mapper shape supported only ONE
main heating system, dropping Main 2 entirely.

New shape:
- `MainHeating2` dataclass (slim §14.1-shaped: PCDB ref, fuel type,
  flue type, fan_assisted_flue, percentage_of_heat, SAP code)
- `MainHeating.main_heating_2: Optional[MainHeating2]` — None when
  §14.1 is absent OR lodges only placeholder zeros (the PCDB-only
  convention; the two JSON fixtures + 14 existing Summary fixtures
  all lodge "0 / 0" for an absent Main 2)
- `_extract_main_heating_2` parses §14.1; returns None when neither
  PCDB ref nor SAP code identifies Main 2
- `_map_elmhurst_main_heating_2` builds `MainHeatingDetail` from the
  Main 2 lodgement with `main_heating_number=2` and `main_heating_
  fraction=percentage_of_heat`; strict-raises `UnmappedElmhurstLabel`
  (mirroring Slice S0380.53's Main 1 raise) when Main 2 has neither
  identifier — surfaces coverage gaps at extraction time

Per RdSAP convention "0%" is lodged without a space (vs Main 1's
"100 %" with a space) — robust percentage parse via `rstrip("%")` so
both forms thread through.

Cohort impact:
- 14 existing Summary PDF fixtures + 2 JSON fixtures: Main 2 returns
  None (placeholder zeros) → no 2nd MainHeatingDetail produced → no
  cascade behaviour change (regression-tested: 415 pass + 10 expected
  000565 fails, identical to S0380.53 baseline)
- Cert 000565: 2nd MainHeatingDetail now lodged with sap_code=None,
  pcdb=15100 (Table 105 gas-boiler 88% efficiency), category=2,
  fuel=26 (mains gas), fraction=0

Cascade still uses Main 1 for water-heating efficiency in the WHC
914 branch — that routing fix is the next slice. This commit is
the plumbing-only half; the SAP-result pin residuals are unchanged
at HEAD because the cascade hasn't been wired to read Main 2 yet.

Pyright net-zero on all 3 touched files.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-28 22:36:20 +00:00
..
domain Slice S0380.54: Elmhurst §14.1 Main Heating2 extraction + 2nd MainHeatingDetail 2026-05-28 22:36:20 +00:00
loaders demo generated for use in address2uprn 2026-05-08 14:48:15 +00:00
schema Slice S0380.48: surface real-API pv_batteries[].battery_capacity (5 kWh) 2026-05-28 19:17:02 +00:00
search bolstering testing 2026-04-28 13:46:09 +00:00
surveys Slice S0380.54: Elmhurst §14.1 Main Heating2 extraction + 2nd MainHeatingDetail 2026-05-28 22:36:20 +00:00
__init__.py testing out rebaselining 2026-02-12 22:25:03 +00:00
construction_age_band.py testing out rebaselining 2026-02-12 22:25:03 +00:00
efficiency.py beginning to assembly the parity class 2026-02-04 18:34:59 +00:00
floor.py preparing partiy class 2026-02-05 08:54:27 +00:00
fuel.py beginning to assembly the parity class 2026-02-04 18:34:59 +00:00
heating_controls.py beginning to assembly the parity class 2026-02-04 18:34:59 +00:00
hotwater.py beginning to assembly the parity class 2026-02-04 18:34:59 +00:00
main_heating.py beginning to assembly the parity class 2026-02-04 18:34:59 +00:00
property_type_built_form.py beginning to assembly the parity class 2026-02-04 18:34:59 +00:00
roof.py beginning to assembly the parity class 2026-02-04 18:34:59 +00:00
walls.py beginning to assembly the parity class 2026-02-04 18:34:59 +00:00
windows.py testing out rebaselining 2026-02-12 22:25:03 +00:00