diff --git a/backend/documents_parser/tests/test_summary_pdf_mapper_chain.py b/backend/documents_parser/tests/test_summary_pdf_mapper_chain.py index d6b61a64..dfb21f1e 100644 --- a/backend/documents_parser/tests/test_summary_pdf_mapper_chain.py +++ b/backend/documents_parser/tests/test_summary_pdf_mapper_chain.py @@ -650,6 +650,34 @@ def test_api_0380_heat_pump_no_secondary_heating_per_table_11() -> None: assert result.secondary_heating_fuel_kwh_per_yr == 0.0 +def test_api_0380_heat_pump_no_pumps_fans_kwh_per_table_4f() -> None: + # Arrange — SAP 10.2 Table 4f lists annual pumps + fans electricity + # consumption by main heating category. Gas-fired boilers (cat 2) + # use 160 kWh/yr (115 central heating pump + 45 flue fan). Heat + # pumps (cat 4) have NO additional pumps/fans contribution because + # the HP system's circulation pump and fans are already + # incorporated into the system COP. + # + # The cascade's `_PUMPS_FANS_KWH_BY_MAIN_CATEGORY` dict only had a + # cat-2 entry; cat-4 HP certs fell through to the DEFAULT 130 + # kWh/yr (~£17 at 13.19 p/kWh) — the worksheet line (249) "Pumps, + # fans and electric keep-hot" shows 0.0000 kWh/yr for cert 0380. + doc = json.loads(_API_0380_JSON.read_text()) + epc = EpcPropertyDataMapper.from_api_response(doc) + + # Act + from domain.sap10_calculator.calculator import calculate_sap_from_inputs + from domain.sap10_calculator.rdsap.cert_to_inputs import ( + cert_to_inputs, SAP_10_2_SPEC_PRICES, + ) + result = calculate_sap_from_inputs( + cert_to_inputs(epc, prices=SAP_10_2_SPEC_PRICES) + ) + + # Assert + assert result.pumps_fans_kwh_per_yr == 0.0 + + def test_api_9501_room_in_roof_surfaces_populated() -> None: # Arrange — cert 9501's API JSON lodges measured RR detail under # `sap_room_in_roof.room_in_roof_details`: two gable walls diff --git a/domain/sap10_calculator/rdsap/cert_to_inputs.py b/domain/sap10_calculator/rdsap/cert_to_inputs.py index e0910422..45aa4096 100644 --- a/domain/sap10_calculator/rdsap/cert_to_inputs.py +++ b/domain/sap10_calculator/rdsap/cert_to_inputs.py @@ -173,6 +173,11 @@ _DEFAULT_PUMPS_FANS_KWH_PER_YR: Final[float] = 130.0 # (Table 4f spec lines 7905-8076) — deferred until a fixture exercises. _PUMPS_FANS_KWH_BY_MAIN_CATEGORY: Final[dict[int, float]] = { 2: 160.0, # Gas-fired boilers (115 pump + 45 flue fan) + 4: 0.0, # Heat pumps — circulation pump + fans already in COP + # per SAP 10.2 Table 4f. Worksheet line (249) shows + # 0 kWh on cert 0380 (HP ASHP). Without this explicit + # entry HP certs fell through to the 130 kWh/yr DEFAULT + # and over-billed £17/yr at electricity rate. } # SAP10.2 Table 6d note 1: "average or unknown" overshading is the # default for existing dwellings. RdSAP doesn't lodge a per-dwelling