From 9d106d9d6d1453e8a827abf4c62cff7fa88c8890 Mon Sep 17 00:00:00 2001 From: Khalim Conn-Kowlessar Date: Wed, 1 Jul 2026 16:48:45 +0000 Subject: [PATCH] =?UTF-8?q?Deterministically=20guard=20the=20electric-unde?= =?UTF-8?q?rfloor=20descriptions=20=F0=9F=9F=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 4.8 (1M context) --- domain/epc/property_overrides/main_heating_guard.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/domain/epc/property_overrides/main_heating_guard.py b/domain/epc/property_overrides/main_heating_guard.py index 8347651bf..bf69d42c0 100644 --- a/domain/epc/property_overrides/main_heating_guard.py +++ b/domain/epc/property_overrides/main_heating_guard.py @@ -20,6 +20,10 @@ def main_heating_guard(description: str) -> Optional[MainHeatingSystemType]: solid-fuel room heaters (open fire 631 / + back boiler 632 / closed + boiler 634) and electric ``"NA"``-type boilers (SAP 191). "NA" is the boiler-type value meaning "not a gas combi/regular/CPSU", i.e. an electric boiler. + - **Electric underfloor** (ADR-0046): dumped into Direct-acting (191) / old + storage (401) for want of the dedicated SAP underfloor codes — in concrete + slab (421, off-peak), integrated storage+direct-acting (422), in screed (424, + meter deferred to the cert). Returns ``None`` for descriptions the LLM already classifies correctly (genuine gas boilers, other storage subtypes, a plain closed room heater) and for varied @@ -30,6 +34,14 @@ def main_heating_guard(description: str) -> Optional[MainHeatingSystemType]: text = description.lower() if "high heat retention" in text: return MainHeatingSystemType.ELECTRIC_STORAGE_HIGH_HEAT_RETENTION + if "underfloor" in text: + if "concrete slab" in text: + return MainHeatingSystemType.ELECTRIC_UNDERFLOOR_SLAB_OFF_PEAK + if "integrated" in text: + return MainHeatingSystemType.ELECTRIC_UNDERFLOOR_INTEGRATED + if "screed" in text: + return MainHeatingSystemType.ELECTRIC_UNDERFLOOR_SCREED + return None if "rated na" in text: return MainHeatingSystemType.ELECTRIC_BOILER if "open fire" in text and "back boiler" in text: