Gate community-heated dwellings from HHRSH recommendation 🟩

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Daniel Roth 2026-07-01 14:14:52 +00:00
parent afe6638b36
commit 3d562be398

View file

@ -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 301304 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