From 895df42afe7725de9382b2664548cae8394d5181 Mon Sep 17 00:00:00 2001 From: Khalim Conn-Kowlessar Date: Tue, 14 Jul 2026 21:56:27 +0000 Subject: [PATCH] =?UTF-8?q?Keep=20a=20PasHub=20system-build=20wall=20off?= =?UTF-8?q?=20the=20basement=20cascade=20=F0=9F=9F=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PasHub surveys never lodge a basement wall, but "System Build (i.e Any Other)" maps to wall code 6 — the gov-API basement sentinel — and with wall_is_basement left None the dwelling silently routed through the basement wall/floor U-value cascade (issue #1590 bug 7). Both part builders now pin the flag False. Harness MAE 1.732 -> 1.727. Co-Authored-By: Claude Opus 4.8 (1M context) --- datatypes/epc/domain/mapper.py | 10 ++++++++++ datatypes/epc/domain/tests/test_from_site_notes.py | 1 + 2 files changed, 11 insertions(+) diff --git a/datatypes/epc/domain/mapper.py b/datatypes/epc/domain/mapper.py index 1985db439..957573249 100644 --- a/datatypes/epc/domain/mapper.py +++ b/datatypes/epc/domain/mapper.py @@ -5990,6 +5990,11 @@ def _map_main_building_part( return SapBuildingPart( identifier=BuildingPartIdentifier.MAIN, construction_age_band=_extract_age_band(main.age_range), + # PasHub surveys never lodge a basement wall; pin the flag so a + # "System Build" wall (code 6, which doubles as the gov-API basement + # sentinel) is not silently routed through the basement wall/floor + # cascade (issue #1590 bug 7). + wall_is_basement=False, wall_construction=_pashub_wall_construction_int( main.walls_construction_type ), @@ -6021,6 +6026,11 @@ def _map_extension_building_part( return SapBuildingPart( identifier=BuildingPartIdentifier.extension(ext_c.id), construction_age_band=_extract_age_band(ext_c.age_range), + # PasHub surveys never lodge a basement wall; pin the flag so a + # "System Build" wall (code 6, which doubles as the gov-API basement + # sentinel) is not silently routed through the basement wall/floor + # cascade (issue #1590 bug 7). + wall_is_basement=False, wall_construction=_pashub_wall_construction_int( ext_c.walls_construction_type ), diff --git a/datatypes/epc/domain/tests/test_from_site_notes.py b/datatypes/epc/domain/tests/test_from_site_notes.py index 151fbbf1e..42f8e62bb 100644 --- a/datatypes/epc/domain/tests/test_from_site_notes.py +++ b/datatypes/epc/domain/tests/test_from_site_notes.py @@ -1145,6 +1145,7 @@ class TestFromSiteNotesExample1: SapBuildingPart( identifier=BuildingPartIdentifier.MAIN, construction_age_band="I", + wall_is_basement=False, # PasHub never lodges a basement wall wall_construction=4, # "Cavity" → SAP10 code 4 (WALL_CAVITY) wall_insulation_type=4, # "As built" → SAP10 code 4 (as built/assumed) wall_thickness_measured=True,