From ea6d42634935ccf4f9a119f7e62722d91f512d7b Mon Sep 17 00:00:00 2001 From: Khalim Conn-Kowlessar Date: Sun, 24 May 2026 15:28:10 +0000 Subject: [PATCH] =?UTF-8?q?Slice=2044:=20flat=5Froof=5Finsulation=5Fthickn?= =?UTF-8?q?ess=20mapper=20fix=20=E2=80=94=20surface=20lodged=20value=20on?= =?UTF-8?q?=20SapBuildingPart?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 4.7 --- datatypes/epc/domain/mapper.py | 5 +++++ .../epc/domain/tests/test_from_rdsap_schema.py | 15 +++++++++++++++ datatypes/epc/schema/tests/fixtures/21_0_1.json | 1 + 3 files changed, 21 insertions(+) diff --git a/datatypes/epc/domain/mapper.py b/datatypes/epc/domain/mapper.py index 14ac33ec..a5c89914 100644 --- a/datatypes/epc/domain/mapper.py +++ b/datatypes/epc/domain/mapper.py @@ -730,6 +730,7 @@ class EpcPropertyDataMapper: wall_insulation_thickness=bp.wall_insulation_thickness, floor_heat_loss=bp.floor_heat_loss, floor_insulation_thickness=bp.floor_insulation_thickness, + flat_roof_insulation_thickness=bp.flat_roof_insulation_thickness, roof_construction=bp.roof_construction, roof_insulation_location=bp.roof_insulation_location, roof_insulation_thickness=bp.roof_insulation_thickness, @@ -875,6 +876,7 @@ class EpcPropertyDataMapper: wall_insulation_thickness=bp.wall_insulation_thickness, floor_heat_loss=bp.floor_heat_loss, floor_insulation_thickness=bp.floor_insulation_thickness, + flat_roof_insulation_thickness=bp.flat_roof_insulation_thickness, roof_construction=bp.roof_construction, roof_insulation_location=bp.roof_insulation_location, roof_insulation_thickness=bp.roof_insulation_thickness, @@ -1037,6 +1039,7 @@ class EpcPropertyDataMapper: wall_insulation_thickness=bp.wall_insulation_thickness, floor_heat_loss=bp.floor_heat_loss, floor_insulation_thickness=bp.floor_insulation_thickness, + flat_roof_insulation_thickness=bp.flat_roof_insulation_thickness, roof_construction=bp.roof_construction, roof_insulation_location=bp.roof_insulation_location, roof_insulation_thickness=bp.roof_insulation_thickness, @@ -1226,6 +1229,7 @@ class EpcPropertyDataMapper: wall_insulation_thickness=bp.wall_insulation_thickness, floor_heat_loss=bp.floor_heat_loss, floor_insulation_thickness=bp.floor_insulation_thickness, + flat_roof_insulation_thickness=bp.flat_roof_insulation_thickness, roof_construction=bp.roof_construction, roof_insulation_location=bp.roof_insulation_location, roof_insulation_thickness=bp.roof_insulation_thickness, @@ -1484,6 +1488,7 @@ class EpcPropertyDataMapper: wall_insulation_thickness=bp.wall_insulation_thickness, floor_heat_loss=bp.floor_heat_loss, floor_insulation_thickness=bp.floor_insulation_thickness, + flat_roof_insulation_thickness=bp.flat_roof_insulation_thickness, roof_construction=bp.roof_construction, roof_insulation_location=bp.roof_insulation_location, roof_insulation_thickness=bp.roof_insulation_thickness, diff --git a/datatypes/epc/domain/tests/test_from_rdsap_schema.py b/datatypes/epc/domain/tests/test_from_rdsap_schema.py index 428f4b8a..e5ef22c5 100644 --- a/datatypes/epc/domain/tests/test_from_rdsap_schema.py +++ b/datatypes/epc/domain/tests/test_from_rdsap_schema.py @@ -589,6 +589,21 @@ class TestFromRdSapSchema21_0_1: # --- room-in-roof (sap_room_in_roof.room_in_roof_type_1) --- + def test_flat_roof_insulation_thickness_flows_through_on_building_part( + self, result: EpcPropertyData + ) -> None: + # Arrange — schema-21.0.1 lodges flat_roof_insulation_thickness + # on SapBuildingPart as a categorical code (e.g. "AB" for "As + # Built"). EpcPropertyData.SapBuildingPart declares the field; + # without mapper passthrough the flat-roof U-value cascade has + # no insulation signal to use. + + # Act + v = result.sap_building_parts[0].flat_roof_insulation_thickness + + # Assert + assert v == "AB" + def test_sap_room_in_roof_gable_lengths_extracted_from_room_in_roof_type_1( self, result: EpcPropertyData ) -> None: diff --git a/datatypes/epc/schema/tests/fixtures/21_0_1.json b/datatypes/epc/schema/tests/fixtures/21_0_1.json index 9eaed954..79b1c5f1 100644 --- a/datatypes/epc/schema/tests/fixtures/21_0_1.json +++ b/datatypes/epc/schema/tests/fixtures/21_0_1.json @@ -139,6 +139,7 @@ "roof_construction": 4, "wall_construction": 4, "building_part_number": 1, + "flat_roof_insulation_thickness": "AB", "sap_floor_dimensions": [ { "floor": 0,