diff --git a/domain/epc/property_overlays/water_heating_overlay.py b/domain/epc/property_overlays/water_heating_overlay.py new file mode 100644 index 00000000..b65db1b1 --- /dev/null +++ b/domain/epc/property_overlays/water_heating_overlay.py @@ -0,0 +1,22 @@ +"""Map a Landlord-Override water-heating value to a heating Simulation Overlay. + +A water-heating value is one canonical ", " description ("From main +system, mains gas", "Electric immersion, electricity"). The calculator reads the +hot-water arrangement from `sap_heating.water_heating_code` (the SAP Table 4a +system code) and `water_heating_fuel`, so the overlay decomposes the value into +those two int codes and emits a whole-dwelling `HeatingOverlay` (water heating is +not per-building-part, so `building_part` is ignored). It composes field-wise with +the main_fuel / main_heating overlays. Unresolvable values produce no overlay. +""" + +from __future__ import annotations + +from typing import Optional + +from domain.modelling.simulation import EpcSimulation + + +def water_heating_overlay_for( + water_heating_value: str, building_part: int +) -> Optional[EpcSimulation]: + raise NotImplementedError diff --git a/tests/domain/epc/test_water_heating_overlay.py b/tests/domain/epc/test_water_heating_overlay.py new file mode 100644 index 00000000..f9379184 --- /dev/null +++ b/tests/domain/epc/test_water_heating_overlay.py @@ -0,0 +1,22 @@ +"""The Landlord-Override water-heating → heating Simulation Overlay mapping. + +A water-heating value resolves to the SAP `water_heating_code` (system) and +`water_heating_fuel` the calculator reads; the overlay is whole-dwelling. +""" + +from __future__ import annotations + +from domain.epc.property_overlays.water_heating_overlay import ( + water_heating_overlay_for, +) + + +def test_from_main_system_mains_gas_overlays_water_heating() -> None: + # Act + simulation = water_heating_overlay_for("From main system, mains gas", 0) + + # Assert — "from main system" is water_heating_code 901, mains gas fuel 26. + assert simulation is not None + assert simulation.heating is not None + assert simulation.heating.water_heating_code == 901 + assert simulation.heating.water_heating_fuel == 26