Merge pull request #1640 from Hestia-Homes/fix/elmhurst-piv-loft-ventilation

Map Elmhurst 'Positive input from loft' ventilation to natural
This commit is contained in:
KhalimCK 2026-07-16 17:40:02 +01:00 committed by GitHub
commit cc185e5d73
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 28 additions and 0 deletions

View file

@ -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",
}

View file

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