From d301ec3be503428097211cbc979d46a401d50f4a Mon Sep 17 00:00:00 2001 From: Khalim Conn-Kowlessar Date: Thu, 16 Jul 2026 16:26:15 +0000 Subject: [PATCH 1/2] =?UTF-8?q?Map=20Elmhurst=20'Positive=20input=20from?= =?UTF-8?q?=20loft'=20ventilation=20to=20natural=20=F0=9F=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 4.8 (1M context) --- .../test_mapper_ventilation_piv_loft.py | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 tests/datatypes/epc/domain/test_mapper_ventilation_piv_loft.py diff --git a/tests/datatypes/epc/domain/test_mapper_ventilation_piv_loft.py b/tests/datatypes/epc/domain/test_mapper_ventilation_piv_loft.py new file mode 100644 index 000000000..60dc529e7 --- /dev/null +++ b/tests/datatypes/epc/domain/test_mapper_ventilation_piv_loft.py @@ -0,0 +1,24 @@ +"""Mapper boundary: the Elmhurst §12.1 "Positive input from loft" mechanical- +ventilation label. + +SAP 10.2 §2 (24d) treats positive input ventilation sourced from the LOFT as +natural ventilation — unlike PIV from OUTSIDE, which is whole-house extract and +resolves to EXTRACT_OR_PIV_OUTSIDE / (24c). The MechanicalVentilationKind.NATURAL +docstring states the loft case explicitly. Before this mapping existed the label +raised UnmappedElmhurstLabel, blocking the whole Summary (surfaced across 8 WCHG +Elmhurst certs). +""" + +from datatypes.epc.domain.mapper import ( + _elmhurst_mv_kind, # pyright: ignore[reportPrivateUsage] +) + + +def test_positive_input_from_loft_maps_to_natural() -> None: + # Arrange — the Elmhurst §12.1 PIV-from-loft ventilation label. + + # Act + kind = _elmhurst_mv_kind("Positive input from loft") + + # Assert — SAP 10.2 §2 (24d): loft-sourced PIV is treated as natural vent. + assert kind == "NATURAL" From c5333692449e29e4c5afa7cb90a63f1ac9483bfa Mon Sep 17 00:00:00 2001 From: Khalim Conn-Kowlessar Date: Thu, 16 Jul 2026 16:27:00 +0000 Subject: [PATCH 2/2] =?UTF-8?q?Map=20Elmhurst=20'Positive=20input=20from?= =?UTF-8?q?=20loft'=20ventilation=20to=20natural=20=F0=9F=9F=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Positive input ventilation sourced from the loft is treated as natural ventilation under SAP 10.2 §2 (24d) — matching the MechanicalVentilationKind .NATURAL contract — so the label now resolves instead of raising UnmappedElmhurstLabel and blocking the whole Elmhurst Summary. Surfaced on 8 WCHG Elmhurst certs (e.g. 29 Piper Hill Avenue, 38 Bucklow Drive). Co-Authored-By: Claude Opus 4.8 (1M context) --- datatypes/epc/domain/mapper.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/datatypes/epc/domain/mapper.py b/datatypes/epc/domain/mapper.py index acf3c615d..4159bf658 100644 --- a/datatypes/epc/domain/mapper.py +++ b/datatypes/epc/domain/mapper.py @@ -9776,6 +9776,10 @@ _ELMHURST_MV_TYPE_TO_KIND: Dict[str, str] = { # picking which (25)m formula to apply. "Mechanical extract, decentralised (MEV dc)": "EXTRACT_OR_PIV_OUTSIDE", "Mechanical ventilation with heat recovery (MVHR)": "MVHR", + # PIV from the loft is treated as natural ventilation → (24d)m (per the + # MechanicalVentilationKind.NATURAL contract); only PIV from OUTSIDE is + # whole-house extract → EXTRACT_OR_PIV_OUTSIDE / (24c)m. + "Positive input from loft": "NATURAL", }