From 6d8139e47e072faf1b69cb0c73e6d97737061703 Mon Sep 17 00:00:00 2001 From: Khalim Conn-Kowlessar Date: Fri, 3 Jul 2026 14:04:56 +0000 Subject: [PATCH] =?UTF-8?q?Electric=20boiler=20and=20CPSU=20overrides=20st?= =?UTF-8?q?amp=20the=20Table=204a=20boiler=20category=20(2)=20=F0=9F=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Supersedes the "direct-acting electric drags no control/category" pin: None does not mean unset — it means inherit the replaced system's value (ADR-0048 bug class), verified suppressing HHRSH on portfolio 796. Co-Authored-By: Claude Opus 4.8 --- .../epc/test_main_heating_system_overlay.py | 25 ++++++++++++++----- 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/tests/domain/epc/test_main_heating_system_overlay.py b/tests/domain/epc/test_main_heating_system_overlay.py index 5c1b680d2..45ecc9ecf 100644 --- a/tests/domain/epc/test_main_heating_system_overlay.py +++ b/tests/domain/epc/test_main_heating_system_overlay.py @@ -434,14 +434,27 @@ def test_storage_heaters_drag_along_conservative_manual_charge_control( assert simulation.heating.main_heating_category == 7 -def test_direct_acting_electric_does_not_drag_along_a_control() -> None: - # Charge control is a storage concept and full boiler controls are a wet- - # system concept; direct-acting electric panel heaters take neither, so the - # overlay leaves the control untouched. - simulation = main_heating_overlay_for("Direct-acting electric", 0) +@pytest.mark.parametrize( + "main_heating_value", + ["Direct-acting electric", "Electric boiler", "Electric CPSU"], +) +def test_electric_boiler_overlays_the_boiler_category( + main_heating_value: str, +) -> None: + # A system-replacing override must stamp the boiler heating category (SAP + # Table 4a Category 2 — codes 191/192 are wet electric boilers). Leaving it + # unset inherits the replaced system's: on portfolio 796, 30 of the first + # 40 live 191/192 overrides carried an inherited category — 6 (community) + # or 4 (heat pump) suppressed the HHRSH pathway entirely, and 7 (storage) + # made the Table 12a resolver bill direct-acting heat 100% at the off-peak + # low rate (ADR-0052, #1444). + # Act + simulation = main_heating_overlay_for(main_heating_value, 0) + + # Assert — SAP Table 4a Category 2 (boiler system). assert simulation is not None assert simulation.heating is not None - assert simulation.heating.main_heating_control is None + assert simulation.heating.main_heating_category == 2 @pytest.mark.parametrize(