Model/datatypes
Khalim Conn-Kowlessar 784e05ebbf Slice S0380.101: HP SAP code 211-227/521-527 → main_heating_category=4 (SAP 10.2 Table 4a)
SAP 10.2 Table 4a (PDF p.165) lists "Heat pumps" as category 4 for
SAP main-heating codes:

    211-217 — ground/water source heat pumps
    221-227 — air source heat pumps (224 = ASHP 2013+, COP 1.70)
    521-527 — warm-air heat pumps

Cert 000565 Main 1 lodges `Main Heating SAP Code = 224` (ASHP 2013+)
with `PCDF boiler Reference = 0` — i.e. no PCDB Table 362 lookup is
possible. Pre-slice `_elmhurst_main_heating_category` returned None
on this path (the existing PCDB-Table-362-membership check failed),
falling through to the cascade's `_DEFAULT_PUMPS_FANS_KWH_PER_YR =
130` (incorrect — HP circulation pump's electricity is inside the
system COP per SAP 10.2 Table 4f line "Heat pumps", so the cascade
row is 0 kWh/year for category 4).

Single-line fix: after the existing PCDB-resolution branches, check
`mh.main_heating_sap_code in _HEAT_PUMP_SAP_MAIN_HEATING_CODES` and
return category 4 if so. New frozenset of HP codes (subset of the
existing `_ELECTRIC_SAP_MAIN_HEATING_CODES`).

Transient state at HEAD (cert 000565):
- main_heating_category: None → 4 ✓
- pumps_fans cascade: 255.0 → 125.0 kWh/yr (HP base 0 + flue 45 +
  solar HW 80; MEV +127.5 kWh still missing — wiring lands in
  S0380.102)
- sap_score (int): 29 ✓ EXACT preserved
- sap_score_continuous: 28.31 → 28.69 (transient drift +0.39 vs ws;
  the previously-cancelling +130 over-count is gone, restoring the
  MEV-under net negative — closes when S0380.102 lands)

Cohort safety: cohort certs 000474..000516 are gas-combi with
`sap_main_heating_code=None` (PCDB Table 105 boiler identified via
the index instead). No cohort cert affected. Cert 0380 + other
golden HP fixtures lodge category=4 via the API mapper, also
unaffected.

Per the spec citation in [[feedback-spec-citation-in-commits]] +
the standing TODO at mapper.py:4037-4043, this slice is the
category half of the coupled cert 000565 closure arc.

Pyright net-zero per touched file.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-01 16:28:47 +00:00
..
epc Slice S0380.101: HP SAP code 211-227/521-527 → main_heating_category=4 (SAP 10.2 Table 4a) 2026-06-01 16:28:47 +00:00
magicplan typing and renaming 🟪 2026-05-07 13:26:49 +00:00
__init__.py further breaking up code 2023-07-20 12:24:34 +01: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