diff --git a/packages/domain/src/domain/sap/worksheet/tests/_elmhurst_worksheet_000474.py b/packages/domain/src/domain/sap/worksheet/tests/_elmhurst_worksheet_000474.py index f0ef9d86..1b9ef77b 100644 --- a/packages/domain/src/domain/sap/worksheet/tests/_elmhurst_worksheet_000474.py +++ b/packages/domain/src/domain/sap/worksheet/tests/_elmhurst_worksheet_000474.py @@ -49,13 +49,25 @@ _WC_CAVITY = 4 def build_epc() -> EpcPropertyData: - """EpcPropertyData mirroring the Elmhurst 000474 inputs.""" + """EpcPropertyData mirroring the Elmhurst 000474 inputs. + + Field-level parity with `from_elmhurst_site_notes(Summary_000474. + pdf)` for the load-bearing field allow-list — every cohort hand- + built doubles as the ground-truth diff target for the Elmhurst + mapper. Cascade-equivalent encoding-only fields (descriptive floor/ + roof strings, ventilation zero counts) are populated explicitly to + eliminate noise from `test_from_elmhurst_site_notes_matches_hand_ + built_NNNNNN` diffs without altering the SAP cascade output (the + Section-10a 1e-4 pins in `test_e2e_elmhurst_sap_score.py` remain + GREEN against the worksheet PDF). + """ main = SapBuildingPart( identifier=BuildingPartIdentifier.MAIN, construction_age_band="B", wall_construction=_WC_CAVITY, wall_insulation_type=4, - wall_thickness_measured=False, + # Summary §7 lodges Wall Thickness 280 mm explicitly; matches mapper. + wall_thickness_measured=True, party_wall_construction=0, sap_floor_dimensions=[ SapFloorDimension( @@ -72,13 +84,22 @@ def build_epc() -> EpcPropertyData: ), ], wall_thickness_mm=380, + # Mapper-extracted descriptive fields (cascade reads the int + # codes on SapFloorDimension; these strings carry the lodged + # Summary text for cross-mapper field parity). + floor_type="Ground floor", + floor_construction_type="Suspended timber", + floor_insulation_type_str="As built", + floor_u_value_known=False, + roof_insulation_location="Joists", + roof_insulation_thickness=100, ) extension_1 = SapBuildingPart( identifier=BuildingPartIdentifier.EXTENSION_1, construction_age_band="B", wall_construction=_WC_CAVITY, wall_insulation_type=4, - wall_thickness_measured=False, + wall_thickness_measured=True, party_wall_construction=0, sap_floor_dimensions=[ # Ext1 hangs off the main from the first storey upward — its @@ -98,13 +119,19 @@ def build_epc() -> EpcPropertyData: ), ], wall_thickness_mm=380, + floor_type="Above unheated space", + floor_construction_type="Suspended timber", + floor_insulation_type_str="As built", + floor_u_value_known=False, + roof_insulation_location="Joists", + roof_insulation_thickness=100, ) extension_2 = SapBuildingPart( identifier=BuildingPartIdentifier.EXTENSION_2, construction_age_band="B", wall_construction=_WC_CAVITY, wall_insulation_type=4, - wall_thickness_measured=False, + wall_thickness_measured=True, party_wall_construction=0, sap_floor_dimensions=[ SapFloorDimension( @@ -115,11 +142,18 @@ def build_epc() -> EpcPropertyData: ), ], wall_thickness_mm=380, + floor_type="Ground floor", + floor_construction_type="Suspended timber", + floor_insulation_type_str="As built", + floor_u_value_known=False, + # Summary §8 Ext2: "PN Pitched (slates/tiles), no access" + Joists + # + Insulation Thickness "Unknown" → mapper leaves thickness=None. + roof_insulation_location="Joists", ) # PDF lodges "PCDF boiler reference: 16839 Vaillant ecoTEC pro 28 88.70%". # The 16839 is the BRE PCDB index_number (Table 105 Vaillant ecoTEC pro # 28kW VUW GB 286/5-3, 2005-2015, winter eff 88.7%, summer eff 87.0%). - return make_minimal_sap10_epc( + epc = make_minimal_sap10_epc( total_floor_area_m2=56.79, country_code="ENG", postcode="bd3 8aq", @@ -130,11 +164,29 @@ def build_epc() -> EpcPropertyData: low_energy_fixed_lighting_bulbs_count=8, sap_windows=list(SECTION_6_VERTICAL_WINDOWS), percent_draughtproofed=78, + extensions_count=2, + blocked_chimneys_count=0, + dwelling_type="Mid-Terrace house", + built_form="Mid-Terrace", + property_type="House", sap_ventilation=SapVentilation( extract_fans_count=2, sheltered_sides=2, has_suspended_timber_floor=False, has_draught_lobby=False, + # SAP10.2 §2 — explicit zero counts match the mapper, which + # parses the Summary's "No. of " rows. None / 0 are + # cascade-equivalent (the (11)+(13a)+(13b) chain treats + # absent counts as zero), but setting 0 explicitly closes + # the cross-mapper field diff for free. + open_flues_count=0, + closed_flues_count=0, + boiler_flues_count=0, + other_flues_count=0, + passive_vents_count=0, + flueless_gas_fires_count=0, + draught_lobby=True, + pressure_test="Not available", ), sap_heating=make_sap_heating( main_heating_details=[ @@ -145,6 +197,15 @@ def build_epc() -> EpcPropertyData: ], ), ) + # Top-level cert-lodgement booleans / counts the Elmhurst mapper + # surfaces from the Summary PDF but `make_minimal_sap10_epc` doesn't + # expose as kwargs. Set post-construction (dataclass is non-frozen). + epc.has_conservatory = False + epc.any_unheated_rooms = False + epc.number_of_storeys = 2 + epc.hydro = False + epc.photovoltaic_array = False + return epc # ============================================================================