From 6356adb523098bb0ad965a7a0b99d45b84ac04f2 Mon Sep 17 00:00:00 2001 From: Daniel Roth Date: Thu, 16 Jul 2026 16:11:43 +0000 Subject: [PATCH] =?UTF-8?q?Suppress=20floor=20heat=20loss=20for=20internal?= =?UTF-8?q?=20floors=20over=20the=20same=20dwelling=20=F0=9F=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Fable 5 --- .../epc/domain/tests/test_from_site_notes.py | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/datatypes/epc/domain/tests/test_from_site_notes.py b/datatypes/epc/domain/tests/test_from_site_notes.py index da5b68768..8e31f0ae6 100644 --- a/datatypes/epc/domain/tests/test_from_site_notes.py +++ b/datatypes/epc/domain/tests/test_from_site_notes.py @@ -615,6 +615,29 @@ class TestFloorExposureMapping: assert upper.is_exposed_floor is False assert upper.is_above_partially_heated_space is False + def test_same_dwelling_below_lodges_party_floor_with_no_heat_loss(self) -> None: + # "Same dwelling below" is an internal floor between heated storeys of + # one dwelling — RdSAP 10 §3 gives it NO floor heat loss. Mirrors the + # gov-API code-8 precedent: normalize to the "(another dwelling + # below)" suppression string `heat_transmission.py` substring-matches + # to zero the part's floor loss, and keep both Table 20/§5.14 + # exposure flags off (it is neither exposed nor above a partially + # heated space). + # Arrange + data = load("pashub_rdsap_site_notes_example1.json") + data["building_construction"]["floor"]["floor_type"] = "Same dwelling below" + survey = from_dict(PasHubRdSapSiteNotes, data) + + # Act + result = EpcPropertyDataMapper.from_site_notes(survey) + + # Assert — the party-floor suppression string and no exposure flags. + part = result.sap_building_parts[0] + assert part.floor_type == "(another dwelling below)" + ground = self._ground(part) + assert ground.is_exposed_floor is False + assert ground.is_above_partially_heated_space is False + def test_ground_floor_type_leaves_both_flags_off(self) -> None: # Arrange — the fixture as lodged ("Ground Floor"). survey = from_dict(