Suppress floor heat loss for internal floors over the same dwelling 🟥

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Daniel Roth 2026-07-16 16:11:43 +00:00
parent 01cacc579a
commit 6356adb523

View file

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