diff --git a/datatypes/epc/domain/mapper.py b/datatypes/epc/domain/mapper.py index dccc610b0..139f31bd3 100644 --- a/datatypes/epc/domain/mapper.py +++ b/datatypes/epc/domain/mapper.py @@ -6551,6 +6551,13 @@ _PASHUB_VENTILATION_TYPE_TO_KIND: Dict[str, Optional[str]] = { "Mechanical Extract - Centralised": "EXTRACT_OR_PIV_OUTSIDE", "Positive Input - From Outside": "EXTRACT_OR_PIV_OUTSIDE", "Positive Input - From Loft (As Natural)": None, + # Balanced mechanical ventilation with heat recovery. PasHub's survey + # form carries no PCDF product index / wet-room count / duct type, so + # `_mvhr_system_values` always takes the Table 4g default branch + # (66% × 0.70 in-use = 46.2% heat recovery) regardless of the installed + # unit — expect these dwellings in the accuracy tail until PasHub + # captures the MVHR product reference (#1637). + "MV - Heat Recovery": "MVHR", } @@ -6581,6 +6588,14 @@ _PASHUB_COMMUNITY_HEAT_SOURCE_TO_ELMHURST: Dict[str, str] = { "Community heating - boilers only": "Boilers", } +# PasHub community-fuel labels that use SAP 10.2 Table 12 row wording rather +# than the Elmhurst §14.1 vocabulary (`_ELMHURST_COMMUNITY_BOILER_FUEL_TO_ +# TABLE_12` covers "Mains Gas"/"Biomass" etc.). 43 = heat from boilers — +# biomass (Table 12, PDF p.189). +_PASHUB_COMMUNITY_FUEL_TO_TABLE_12: Dict[str, int] = { + "Heat from boilers - biomass": 43, +} + def _pashub_community_heating( heat_source_label: str, fuel_label: str @@ -6589,14 +6604,20 @@ def _pashub_community_heating( code, Table 12 fuel code) at the mapper boundary (ADR-0015), reusing `_resolve_community_heating_fuel_code`. An uncovered heat-source label strict-raises so the dwelling is never silently priced as an ordinary - boiler (issue #1590 follow-up, fixture 507644414148).""" + boiler (issue #1590 follow-up, fixture 507644414148); an uncovered + non-empty fuel label strict-raises too, rather than passing the raw + string through to the calculator's deep `MissingMainFuelType`.""" if heat_source_label not in _PASHUB_COMMUNITY_HEAT_SOURCE_TO_SAP_CODE: raise UnmappedPasHubLabel("community heat source", heat_source_label) sap_code = _PASHUB_COMMUNITY_HEAT_SOURCE_TO_SAP_CODE[heat_source_label] - fuel = _resolve_community_heating_fuel_code( - _PASHUB_COMMUNITY_HEAT_SOURCE_TO_ELMHURST[heat_source_label], - fuel_label, - ) + fuel = _PASHUB_COMMUNITY_FUEL_TO_TABLE_12.get(fuel_label) + if fuel is None: + fuel = _resolve_community_heating_fuel_code( + _PASHUB_COMMUNITY_HEAT_SOURCE_TO_ELMHURST[heat_source_label], + fuel_label, + ) + if fuel is None and fuel_label: + raise UnmappedPasHubLabel("community fuel", fuel_label) return sap_code, fuel