Electric underfloor override stamps the Table 4a underfloor category (8) 🟩

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Khalim Conn-Kowlessar 2026-07-03 11:36:30 +00:00
parent 51fa497793
commit 57e899e8d9

View file

@ -134,6 +134,13 @@ _ELECTRIC_BOILER_CODES = frozenset({191, 192})
# unambiguously electric (ADR-0046).
_ELECTRIC_UNDERFLOOR_CODES = frozenset({421, 422, 424})
# SAP Table 4a "electric underfloor heating" category. Stamped so an underfloor
# override never leaves the replaced system's category behind — property 711795
# (PRD #1435 WS2) kept a replaced heat network's category 6, which the heating
# generator's `is_heat_network_main` gate read as community heating: no heating
# upgrade was offered at all and the baseline mis-rated 51 vs 67 (ADR-0050).
_UNDERFLOOR_CATEGORY = 8
# Heat pumps (SAP Table 4a 211-224 wet, 521-527 warm-air) are category 4 and
# unambiguously electric (natural fuel 29). Modellable on the default code's SPF
# without a PCDB index (ADR-0041).
@ -287,6 +294,8 @@ def _category_for(code: int) -> Optional[int]:
return _ROOM_HEATER_CATEGORY
if code in _STORAGE_HEATER_CODES:
return _STORAGE_HEATER_CATEGORY
if code in _ELECTRIC_UNDERFLOOR_CODES:
return _UNDERFLOOR_CATEGORY
if code in _HEAT_PUMP_CODES:
return _HEAT_PUMP_CATEGORY
if code in _HEAT_NETWORK_CODES: