Model/domain
Khalim Conn-Kowlessar b8ea20988f Slice S0380.55: cascade WHC 914 → Main 2 water-heating efficiency routing
Closes the second half of the cert 000565 Main 2 work. After Slice
S0380.54 lodged Main 2 on the EpcPropertyData, the water-heating
cascade still derived efficiency from Main 1 (the heat pump) instead
of Main 2 (the gas combi that actually services DHW).

Per the Elmhurst RdSAP convention, `Water Heating SapCode 914` =
"from second main system" — DHW is generated by Main 2, not Main 1.
The §4 / Appendix D2.1 summer-efficiency lookup must therefore key
off Main 2's PCDB Table 105 record (cert 000565: PCDB 15100 Vaillant
Ecotec plus 415, summer η = 88%) rather than Main 1's HP COP.

Implementation:
- New `_water_heating_main(epc)` helper — returns Main 2 when WHC
  is in `_WATER_FROM_SECOND_MAIN_CODES = {914}` AND a second main is
  lodged; otherwise returns Main 1 (matches prior behaviour for
  single-main certs + WHC 901/902 "from main system")
- The water-eff branch at the §4 cascade now reads `water_pcdb_main
  = gas_oil_boiler_record(water_main.main_heating_index_number)`
  + `_water_efficiency_with_category_inherit(water_main.sap_main_
  heating_code, water_main.main_heating_category, _main_fuel_code(
  water_main))` — same logic as before but parametrised by the
  water-heating main rather than hard-coded to Main 1

Cert 000565 cascade impact on hot_water_kwh_per_yr pin:
- Before: actual 1,844.66 kWh/yr (= HW heat / HP COP 1.70 — wrong)
  Δ −1,910.36 vs U985-0001-000565.pdf expected 3,755.03
  After Slice S0380.54 (Main 2 lodged but cascade still using Main 1):
  actual 3,919.91 kWh/yr, Δ +164.88 (regression from the no-cascade
  baseline because Main 2 PCDB was lodged but water_eff still came
  from Main 1's HP-vs-default fallthrough)
- After this slice: actual 3,969.53 kWh/yr (= HW heat / 0.88)
  Δ +214.50 — 89% reduction vs the original Main-1 WHC 914 routing,
  remaining gap is fine-grained (FGHRS / solar HW / Table 3a no-keep-
  hot territory — separate slice)

For single-main certs (the 14 existing Summary fixtures + 8 ASHP
cohort certs): `_water_heating_main` returns Main 1, identical to
the prior `main` reference. Cohort regression check: 472 pass + 10
expected 000565 fails — no broader regression.

Spec source: SAP 10.2 §4 water-heating cascade + Appendix D2.1 (D1
equation) summer-efficiency override; Elmhurst RdSAP water-heating
code 914 ("from second main system").

Pyright net-zero on cert_to_inputs.py (34 errors before, 34 after).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-01 16:28:47 +00:00
..
addresses standardist Address 2026-05-22 10:13:32 +00:00
data_transformation moved classifier data transformation to an easy one 2026-06-01 14:53:34 +00:00
epc pr review, move domain and orhcestration 2026-06-01 14:00:31 +00:00
sap10_calculator Slice S0380.55: cascade WHC 914 → Main 2 water-heating efficiency routing 2026-06-01 16:28:47 +00:00
sap10_ml Slice S0380.26: RdSAP10 §5.8 dry-lining adjustment on alt walls — closes cert 7700 -0.44 → +5e-5 2026-06-01 16:28:46 +00:00
tasks added postcode splitter rewrite to ddd 2026-05-19 16:35:09 +00:00
postcode.py get rid of comments 2026-05-20 13:21:11 +00:00