From 2dc6adb5b7be56ee2b598697b4d6e1ee5d351c91 Mon Sep 17 00:00:00 2001 From: Khalim Conn-Kowlessar Date: Sat, 30 May 2026 21:13:54 +0000 Subject: [PATCH] =?UTF-8?q?Slice=20S0380.121:=20map=20floor=5Fconstruction?= =?UTF-8?q?=20code=204=20=E2=86=92=20"Solid"=20(basement=20cert=200712)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The API mapper's `_API_FLOOR_CONSTRUCTION_TO_STR` dispatch covered codes 1 and 2 only. Basement smoke-test fixture `fixtures/basement/0712-3058-2202-3816-8204.json` lodges code 4 on two BPs (paired with `floor_insulation=0` and global floor descriptions "Solid" + "Solid, no insulation (assumed)"). Per the [[reference-unmapped-api-code]] strict-raise pattern, that surfaced as `UnmappedApiCode: floor_construction code: 4` on `test_real_corpus_basement_cert_has_part_with_has_basement_true`. Code 4 is the no-insulation solid-floor variant — semantically a solid floor. The cascade's `u_floor` only distinguishes "Suspended" prefix from everything-else (solid-branch is the fall-through), so the additional code maps to the same "Solid" string as code 1. Test movement: `test_real_corpus_basement_cert_has_part_with_has_basement_true` → PASS. No SAP/PE/CO2 cascade behaviour changes (the smoke test only asserts basement detection from the alt-wall code). Co-Authored-By: Claude Opus 4.7 --- datatypes/epc/domain/mapper.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/datatypes/epc/domain/mapper.py b/datatypes/epc/domain/mapper.py index ee86817a..efe3a7fd 100644 --- a/datatypes/epc/domain/mapper.py +++ b/datatypes/epc/domain/mapper.py @@ -2311,11 +2311,17 @@ def _api_party_wall_construction_int(value: Union[int, str, None]) -> Optional[i # cascade's `u_floor` looks for via the "Suspended"/"Solid" prefix # (see Slice 88 — `heat_transmission.py` consumes `bp.floor_ # construction_type` to choose the suspended-branch BS EN ISO 13370 -# formula). Only the values observed across the 10 golden fixtures -# (1, 2) are mapped; unrecognised codes fall through to None. +# formula). Code 4 observed on cert 0712 (basement smoke-test +# fixture): paired with `floor_insulation=0` and global floor +# descriptions "Solid" + "Solid, no insulation (assumed)" — semantically +# a solid floor with the no-insulation variant. The cascade only +# distinguishes "Suspended" vs everything-else (the solid-branch is +# the default fall-through), so the additional code maps to the same +# "Solid" string as code 1. _API_FLOOR_CONSTRUCTION_TO_STR: Dict[int, str] = { 1: "Solid", 2: "Suspended timber", + 4: "Solid", }