From 3d562be39837fd073ece69dda59eb13e92131b75 Mon Sep 17 00:00:00 2001 From: Daniel Roth Date: Wed, 1 Jul 2026 14:14:52 +0000 Subject: [PATCH] =?UTF-8?q?Gate=20community-heated=20dwellings=20from=20HH?= =?UTF-8?q?RSH=20recommendation=20=F0=9F=9F=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Sonnet 4.6 --- domain/modelling/generators/heating_recommendation.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/domain/modelling/generators/heating_recommendation.py b/domain/modelling/generators/heating_recommendation.py index 4848a0f74..452f63914 100644 --- a/domain/modelling/generators/heating_recommendation.py +++ b/domain/modelling/generators/heating_recommendation.py @@ -15,7 +15,7 @@ produced by scoring (ADR-0016). from typing import Optional from datatypes.epc.domain.epc_property_data import EpcPropertyData, MainHeatingDetail -from datatypes.epc.domain.field_mappings import PROPERTY_TYPE_LOOKUP +from datatypes.epc.domain.field_mappings import PROPERTY_TYPE_LOOKUP, is_heat_network_main from domain.geospatial.planning_restrictions import PlanningRestrictions from domain.modelling.products import ( AshpCostInputs, @@ -718,11 +718,14 @@ def _hhr_storage_eligible(epc: EpcPropertyData) -> bool: heat pump. Eligibility keys on the heating *fuel* (main_fuel_type not in _GAS_FUEL_CODES), not the gas-connection flag — a dwelling on a gas street with electric or oil heating has gas_connection_available=True but still - qualifies.""" + qualifies. Community heating (SAP Table 4a codes 301–304 or category 6) is + excluded by topology regardless of fuel: ripping out a shared heat network + to install storage heaters is never appropriate.""" main: MainHeatingDetail = epc.sap_heating.main_heating_details[0] if main.sap_main_heating_code == _HHR_STORAGE_SAP_CODE: return False if main.main_heating_category == _HEAT_PUMP_CATEGORY: return False - non_gas_fuel: bool = main.main_fuel_type not in _GAS_FUEL_CODES - return non_gas_fuel + if is_heat_network_main(main): + return False + return main.main_fuel_type not in _GAS_FUEL_CODES