From 7d70c1d298bbdeb16d554e274251360a06f762e3 Mon Sep 17 00:00:00 2001 From: Jun-te Kim Date: Fri, 19 Jun 2026 14:03:03 +0000 Subject: [PATCH] =?UTF-8?q?Resolve=20a=20landlord=20from-main-gas=20water-?= =?UTF-8?q?heating=20override=20to=20its=20codes=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) --- .../water_heating_overlay.py | 21 +++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/domain/epc/property_overlays/water_heating_overlay.py b/domain/epc/property_overlays/water_heating_overlay.py index b65db1b1..d75ea81c 100644 --- a/domain/epc/property_overlays/water_heating_overlay.py +++ b/domain/epc/property_overlays/water_heating_overlay.py @@ -13,10 +13,27 @@ from __future__ import annotations from typing import Optional -from domain.modelling.simulation import EpcSimulation +from domain.modelling.simulation import EpcSimulation, HeatingOverlay + +# Canonical ", " description → (water_heating_code, water_heating_fuel). +# water_heating_code: 901 "from main system" (SAP Table 4a inherit-from-main), +# 903 "electric immersion". Fuel codes are the modern RdSAP "(not community)" +# family (26 mains gas, 29 electricity), matching the main_fuel overlay. +_WATER_HEATING_CODES: dict[str, tuple[int, int]] = { + "From main system, mains gas": (901, 26), +} def water_heating_overlay_for( water_heating_value: str, building_part: int ) -> Optional[EpcSimulation]: - raise NotImplementedError + codes = _WATER_HEATING_CODES.get(water_heating_value) + if codes is None: + return None + water_heating_code, water_heating_fuel = codes + return EpcSimulation( + heating=HeatingOverlay( + water_heating_code=water_heating_code, + water_heating_fuel=water_heating_fuel, + ) + )