From 266a276dae6ab72b0814d12c8788fd6e45bc6204 Mon Sep 17 00:00:00 2001 From: Daniel Roth Date: Wed, 1 Jul 2026 09:52:06 +0000 Subject: [PATCH] revert changes --- .../generators/heating_recommendation.py | 6 +++--- .../modelling/test_heating_recommendation.py | 20 ------------------- 2 files changed, 3 insertions(+), 23 deletions(-) diff --git a/domain/modelling/generators/heating_recommendation.py b/domain/modelling/generators/heating_recommendation.py index f0c0ccec9..9eae0353e 100644 --- a/domain/modelling/generators/heating_recommendation.py +++ b/domain/modelling/generators/heating_recommendation.py @@ -225,8 +225,8 @@ _RADIATOR_ROOM_OFFSET = 3 _RADIATOR_M2_PER_RADIATOR = 13.0 # main_fuel_type codes (gov API enum and/or Table 12) by fuel. Classification # keys on the heating *fuel*, NOT the `mains_gas` flag — that flag means gas is -# available at the property, which is True for any dwelling on a gas street -# regardless of its actual heating fuel (electric, oil, solid biomass, etc.). +# available at the property, which is True even for electrically-heated dwellings +# on a gas street (every 001431 electric fixture lodges mains_gas=True). _GAS_FUEL_CODES = frozenset({26, 1}) _OIL_FUEL_CODES = frozenset({28, 4, 71, 73, 75, 76}) _LPG_FUEL_CODES = frozenset({27, 2, 3, 5, 9}) @@ -722,6 +722,6 @@ def _hhr_storage_eligible(epc: EpcPropertyData) -> bool: return False if main.main_heating_category == _HEAT_PUMP_CATEGORY: return False - off_gas: bool = main.main_fuel_type not in _GAS_FUEL_CODES + off_gas: bool = not epc.sap_energy_source.mains_gas electric_main: bool = main.main_fuel_type == _ELECTRICITY_FUEL return electric_main or off_gas diff --git a/tests/domain/modelling/test_heating_recommendation.py b/tests/domain/modelling/test_heating_recommendation.py index fcae48860..4f1a321a6 100644 --- a/tests/domain/modelling/test_heating_recommendation.py +++ b/tests/domain/modelling/test_heating_recommendation.py @@ -119,26 +119,6 @@ def test_existing_heat_pump_dwelling_yields_no_hhr_storage_bundle() -> None: assert recommend_heating(baseline, _StubProducts()) is None -def test_solid_biomass_dwelling_with_gas_connection_yields_hhr_storage_bundle() -> None: - # Arrange — wood-pellet heating (fuel 29, SAP code 691, category 10) with - # mains_gas=True. The mains_gas flag means gas is available at the street, - # not that the heating fuel is gas (property 742121 regression). - baseline: EpcPropertyData = _electric_storage_baseline() - main = baseline.sap_heating.main_heating_details[0] - main.main_fuel_type = 29 # wood pellets (bagged) - main.sap_main_heating_code = 691 # solid-fuel room heater - main.main_heating_category = 10 # room heaters — not heat pump (category 4) - baseline.sap_energy_source.mains_gas = True # gas available at street - - # Act - recommendation: Recommendation | None = recommend_heating(baseline, _StubProducts()) - - # Assert — HHRSH is offered: off-gas-heated dwelling despite gas connection - assert recommendation is not None - options = {o.measure_type.value: o for o in recommendation.options} - assert "high_heat_retention_storage_heaters" in options - - def test_hhr_storage_bundle_carries_the_product_cost_and_contingency() -> None: # Arrange baseline: EpcPropertyData = _electric_storage_baseline()