diff --git a/tests/domain/sap10_calculator/rdsap/fixtures/golden/0340-2467-9260-2006-6521.json b/tests/domain/sap10_calculator/rdsap/fixtures/golden/0340-2467-9260-2006-6521.json new file mode 100644 index 00000000..f402740f --- /dev/null +++ b/tests/domain/sap10_calculator/rdsap/fixtures/golden/0340-2467-9260-2006-6521.json @@ -0,0 +1,516 @@ +{ + "uprn": 77048251, + "roofs": [ + { + "description": "Pitched, 300 mm loft insulation", + "energy_efficiency_rating": 5, + "environmental_efficiency_rating": 5 + } + ], + "walls": [ + { + "description": "Cavity wall, filled cavity", + "energy_efficiency_rating": 4, + "environmental_efficiency_rating": 4 + } + ], + "floors": [ + { + "description": "Solid, no insulation (assumed)", + "energy_efficiency_rating": 0, + "environmental_efficiency_rating": 0 + } + ], + "status": "entered", + "tenure": 2, + "window": { + "description": "Fully double glazed", + "energy_efficiency_rating": 3, + "environmental_efficiency_rating": 3 + }, + "addendum": { + "addendum_numbers": [ + 15 + ] + }, + "lighting": { + "description": "Good lighting efficiency", + "energy_efficiency_rating": 4, + "environmental_efficiency_rating": 4 + }, + "postcode": "M22 1UR", + "hot_water": { + "description": "From main system", + "energy_efficiency_rating": 4, + "environmental_efficiency_rating": 4 + }, + "post_town": "MANCHESTER", + "built_form": 2, + "created_at": "2026-06-03 14:45:36", + "door_count": 2, + "region_code": 19, + "report_type": 2, + "sap_heating": { + "number_baths": 0, + "cylinder_size": 1, + "shower_outlets": [ + { + "shower_wwhrs": 1, + "shower_outlet_type": 1 + } + ], + "number_baths_wwhrs": 0, + "water_heating_code": 901, + "water_heating_fuel": 26, + "secondary_fuel_type": 29, + "main_heating_details": [ + { + "has_fghrs": "N", + "main_fuel_type": 26, + "boiler_flue_type": 2, + "fan_flue_present": "Y", + "heat_emitter_type": 1, + "emitter_temperature": 0, + "main_heating_number": 1, + "main_heating_control": 2106, + "main_heating_category": 2, + "main_heating_fraction": 1, + "central_heating_pump_age": 0, + "main_heating_data_source": 1, + "main_heating_index_number": 15709 + } + ], + "immersion_heating_type": "NA", + "secondary_heating_type": 691, + "has_fixed_air_conditioning": "false" + }, + "sap_version": 10.2, + "sap_windows": [ + { + "pvc_frame": "true", + "orientation": 1, + "window_type": 1, + "glazing_type": 2, + "window_width": 0.48, + "window_height": 0.92, + "draught_proofed": "true", + "window_location": 0, + "window_wall_type": 1, + "permanent_shutters_present": "N", + "permanent_shutters_insulated": "N" + }, + { + "pvc_frame": "true", + "orientation": 1, + "window_type": 1, + "glazing_type": 2, + "window_width": 0.57, + "window_height": 1.12, + "draught_proofed": "true", + "window_location": 0, + "window_wall_type": 1, + "permanent_shutters_present": "N", + "permanent_shutters_insulated": "N" + }, + { + "pvc_frame": "true", + "orientation": 1, + "window_type": 1, + "glazing_type": 2, + "window_width": 1.44, + "window_height": 1.21, + "draught_proofed": "true", + "window_location": 0, + "window_wall_type": 1, + "permanent_shutters_present": "N", + "permanent_shutters_insulated": "N" + }, + { + "pvc_frame": "true", + "orientation": 2, + "window_type": 1, + "glazing_type": 2, + "window_width": 0.54, + "window_height": 1.11, + "draught_proofed": "true", + "window_location": 0, + "window_wall_type": 1, + "permanent_shutters_present": "N", + "permanent_shutters_insulated": "N" + }, + { + "pvc_frame": "true", + "orientation": 8, + "window_type": 1, + "glazing_type": 2, + "window_width": 0.48, + "window_height": 0.92, + "draught_proofed": "true", + "window_location": 0, + "window_wall_type": 1, + "permanent_shutters_present": "N", + "permanent_shutters_insulated": "N" + }, + { + "pvc_frame": "true", + "orientation": 1, + "window_type": 1, + "glazing_type": 2, + "window_width": 0.61, + "window_height": 1.05, + "draught_proofed": "true", + "window_location": 0, + "window_wall_type": 1, + "permanent_shutters_present": "N", + "permanent_shutters_insulated": "N" + }, + { + "pvc_frame": "true", + "orientation": 1, + "window_type": 1, + "glazing_type": 2, + "window_width": 1, + "window_height": 1.24, + "draught_proofed": "true", + "window_location": 0, + "window_wall_type": 1, + "permanent_shutters_present": "N", + "permanent_shutters_insulated": "N" + }, + { + "pvc_frame": "true", + "orientation": 1, + "window_type": 1, + "glazing_type": 2, + "window_width": 1.83, + "window_height": 1.07, + "draught_proofed": "true", + "window_location": 0, + "window_wall_type": 1, + "permanent_shutters_present": "N", + "permanent_shutters_insulated": "N" + }, + { + "pvc_frame": "true", + "orientation": 7, + "window_type": 1, + "glazing_type": 2, + "window_width": 0.56, + "window_height": 1.13, + "draught_proofed": "true", + "window_location": 0, + "window_wall_type": 1, + "permanent_shutters_present": "N", + "permanent_shutters_insulated": "N" + }, + { + "pvc_frame": "true", + "orientation": 5, + "window_type": 1, + "glazing_type": 2, + "window_width": 1.02, + "window_height": 1.17, + "draught_proofed": "true", + "window_location": 0, + "window_wall_type": 1, + "permanent_shutters_present": "N", + "permanent_shutters_insulated": "N" + }, + { + "pvc_frame": "true", + "orientation": 5, + "window_type": 1, + "glazing_type": 2, + "window_width": 1.93, + "window_height": 1.21, + "draught_proofed": "true", + "window_location": 0, + "window_wall_type": 1, + "permanent_shutters_present": "N", + "permanent_shutters_insulated": "N" + }, + { + "pvc_frame": "true", + "orientation": 5, + "window_type": 1, + "glazing_type": 2, + "window_width": 1.81, + "window_height": 1.29, + "draught_proofed": "true", + "window_location": 0, + "window_wall_type": 1, + "permanent_shutters_present": "N", + "permanent_shutters_insulated": "N" + }, + { + "pvc_frame": "true", + "orientation": 4, + "window_type": 1, + "glazing_type": 2, + "window_width": 0.54, + "window_height": 1.32, + "draught_proofed": "true", + "window_location": 0, + "window_wall_type": 1, + "permanent_shutters_present": "N", + "permanent_shutters_insulated": "N" + }, + { + "pvc_frame": "true", + "orientation": 6, + "window_type": 1, + "glazing_type": 2, + "window_width": 1.93, + "window_height": 1.21, + "draught_proofed": "true", + "window_location": 0, + "window_wall_type": 1, + "permanent_shutters_present": "N", + "permanent_shutters_insulated": "N" + }, + { + "pvc_frame": "true", + "orientation": 5, + "window_type": 1, + "glazing_type": 2, + "window_width": 1.93, + "window_height": 1.13, + "draught_proofed": "true", + "window_location": 0, + "window_wall_type": 1, + "permanent_shutters_present": "N", + "permanent_shutters_insulated": "N" + }, + { + "pvc_frame": "true", + "orientation": 5, + "window_type": 1, + "glazing_type": 2, + "window_width": 0.99, + "window_height": 1.05, + "draught_proofed": "true", + "window_location": 0, + "window_wall_type": 1, + "permanent_shutters_present": "N", + "permanent_shutters_insulated": "N" + }, + { + "pvc_frame": "true", + "orientation": 5, + "window_type": 1, + "glazing_type": 2, + "window_width": 2, + "window_height": 1.21, + "draught_proofed": "true", + "window_location": 0, + "window_wall_type": 1, + "permanent_shutters_present": "N", + "permanent_shutters_insulated": "N" + } + ], + "schema_type": "RdSAP-Schema-21.0.1", + "uprn_source": "Energy Assessor", + "country_code": "ENG", + "main_heating": [ + { + "description": "Boiler and radiators, mains gas", + "energy_efficiency_rating": 4, + "environmental_efficiency_rating": 4 + } + ], + "air_tightness": { + "description": "(not tested)", + "energy_efficiency_rating": 0, + "environmental_efficiency_rating": 0 + }, + "dwelling_type": "Semi-detached house", + "language_code": 1, + "pressure_test": 4, + "property_type": 0, + "address_line_1": "49 Cotefield Road", + "assessment_type": "RdSAP", + "completion_date": "2026-06-03", + "inspection_date": "2026-06-03", + "extensions_count": 0, + "measurement_type": 1, + "total_floor_area": 107, + "transaction_type": 5, + "conservatory_type": 1, + "heated_room_count": 6, + "registration_date": "2026-06-03", + "sap_energy_source": { + "mains_gas": "Y", + "meter_type": 2, + "pv_connection": 0, + "photovoltaic_supply": { + "none_or_no_details": { + "percent_roof_area": 0 + } + }, + "wind_turbines_count": 0, + "gas_smart_meter_present": "false", + "is_dwelling_export_capable": "false", + "wind_turbines_terrain_type": 2, + "electricity_smart_meter_present": "false" + }, + "secondary_heating": { + "description": "Room heaters, electric", + "energy_efficiency_rating": 0, + "environmental_efficiency_rating": 0 + }, + "extract_fans_count": 2, + "sap_building_parts": [ + { + "identifier": "Main Dwelling", + "wall_dry_lined": "N", + "wall_thickness": 300, + "floor_heat_loss": 7, + "roof_construction": 4, + "wall_construction": 4, + "building_part_number": 1, + "sap_floor_dimensions": [ + { + "floor": 0, + "room_height": { + "value": 2.4, + "quantity": "metres" + }, + "floor_insulation": 1, + "total_floor_area": { + "value": 53.63, + "quantity": "square metres" + }, + "party_wall_length": { + "value": 5.63, + "quantity": "metres" + }, + "floor_construction": 1, + "heat_loss_perimeter": { + "value": 26.13, + "quantity": "metres" + } + }, + { + "floor": 1, + "room_height": { + "value": 2.45, + "quantity": "metres" + }, + "total_floor_area": { + "value": 53.63, + "quantity": "square metres" + }, + "party_wall_length": { + "value": 5.63, + "quantity": "metres" + }, + "heat_loss_perimeter": { + "value": 21.78, + "quantity": "metres" + } + } + ], + "wall_insulation_type": 2, + "construction_age_band": "D", + "party_wall_construction": 0, + "wall_thickness_measured": "Y", + "roof_insulation_location": 2, + "roof_insulation_thickness": "300mm", + "wall_insulation_thickness": "NI", + "floor_insulation_thickness": "NI" + } + ], + "solar_water_heating": "N", + "habitable_room_count": 6, + "heating_cost_current": { + "value": 1131, + "currency": "GBP" + }, + "insulated_door_count": 0, + "co2_emissions_current": 2.9, + "energy_rating_average": 60, + "energy_rating_current": 70, + "lighting_cost_current": { + "value": 63, + "currency": "GBP" + }, + "main_heating_controls": [ + { + "description": "Programmer, room thermostat and TRVs", + "energy_efficiency_rating": 4, + "environmental_efficiency_rating": 4 + } + ], + "has_hot_water_cylinder": "false", + "heating_cost_potential": { + "value": 1031, + "currency": "GBP" + }, + "hot_water_cost_current": { + "value": 218, + "currency": "GBP" + }, + "mechanical_ventilation": 0, + "percent_draughtproofed": 100, + "suggested_improvements": [ + { + "sequence": 1, + "typical_saving": { + "value": 100, + "currency": "GBP" + }, + "indicative_cost": "\u00a35,000 - \u00a310,000", + "improvement_type": "W2", + "improvement_details": { + "improvement_number": 58 + }, + "improvement_category": 5, + "energy_performance_rating": 72, + "environmental_impact_rating": 75 + }, + { + "sequence": 2, + "typical_saving": { + "value": 223, + "currency": "GBP" + }, + "indicative_cost": "\u00a38,000 - \u00a310,000", + "improvement_type": "U", + "improvement_details": { + "improvement_number": 34 + }, + "improvement_category": 5, + "energy_performance_rating": 76, + "environmental_impact_rating": 76 + } + ], + "co2_emissions_potential": 2.5, + "energy_rating_potential": 76, + "lighting_cost_potential": { + "value": 63, + "currency": "GBP" + }, + "schema_version_original": "21.0.1", + "hot_water_cost_potential": { + "value": 218, + "currency": "GBP" + }, + "renewable_heat_incentive": { + "water_heating": 2512.47, + "space_heating_existing_dwelling": 9580.15 + }, + "draughtproofed_door_count": 2, + "energy_consumption_current": 154, + "has_fixed_air_conditioning": "false", + "multiple_glazed_proportion": 100, + "calculation_software_version": "5.02r0344", + "energy_consumption_potential": 130, + "environmental_impact_current": 73, + "current_energy_efficiency_band": "C", + "environmental_impact_potential": 76, + "has_heated_separate_conservatory": "false", + "potential_energy_efficiency_band": "C", + "co2_emissions_current_per_floor_area": 27, + "low_energy_fixed_lighting_bulbs_count": 14, + "incandescent_fixed_lighting_bulbs_count": 0 +} \ No newline at end of file diff --git a/tests/domain/sap10_calculator/rdsap/fixtures/golden/5500-5070-0822-0201-3663.json b/tests/domain/sap10_calculator/rdsap/fixtures/golden/5500-5070-0822-0201-3663.json new file mode 100644 index 00000000..421d0d6f --- /dev/null +++ b/tests/domain/sap10_calculator/rdsap/fixtures/golden/5500-5070-0822-0201-3663.json @@ -0,0 +1,523 @@ +{ + "uprn": 77079925, + "roofs": [ + { + "description": "Pitched, 100 mm loft insulation", + "energy_efficiency_rating": 3, + "environmental_efficiency_rating": 3 + }, + { + "description": "Pitched, insulated (assumed)", + "energy_efficiency_rating": 3, + "environmental_efficiency_rating": 3 + } + ], + "walls": [ + { + "description": "Cavity wall, filled cavity", + "energy_efficiency_rating": 4, + "environmental_efficiency_rating": 4 + } + ], + "floors": [ + { + "description": "Suspended, no insulation (assumed)", + "energy_efficiency_rating": 0, + "environmental_efficiency_rating": 0 + } + ], + "status": "entered", + "tenure": 2, + "window": { + "description": "Fully double glazed", + "energy_efficiency_rating": 3, + "environmental_efficiency_rating": 3 + }, + "lighting": { + "description": "Good lighting efficiency", + "energy_efficiency_rating": 4, + "environmental_efficiency_rating": 4 + }, + "postcode": "M22 4FA", + "hot_water": { + "description": "From main system", + "energy_efficiency_rating": 4, + "environmental_efficiency_rating": 4 + }, + "post_town": "MANCHESTER", + "built_form": 2, + "created_at": "2026-06-03 10:48:51", + "door_count": 2, + "region_code": 19, + "report_type": 2, + "sap_heating": { + "number_baths": 1, + "cylinder_size": 1, + "shower_outlets": [ + { + "shower_wwhrs": 1, + "shower_outlet_type": 2 + } + ], + "number_baths_wwhrs": 0, + "water_heating_code": 901, + "water_heating_fuel": 26, + "secondary_fuel_type": 29, + "main_heating_details": [ + { + "has_fghrs": "N", + "main_fuel_type": 26, + "boiler_flue_type": 2, + "fan_flue_present": "Y", + "heat_emitter_type": 1, + "emitter_temperature": 0, + "main_heating_number": 1, + "main_heating_control": 2106, + "main_heating_category": 2, + "main_heating_fraction": 1, + "central_heating_pump_age": 0, + "main_heating_data_source": 1, + "main_heating_index_number": 17741 + } + ], + "immersion_heating_type": "NA", + "secondary_heating_type": 691, + "has_fixed_air_conditioning": "false" + }, + "sap_version": 10.2, + "sap_windows": [ + { + "pvc_frame": "true", + "orientation": 6, + "window_type": 1, + "glazing_type": 2, + "window_width": 0.98, + "window_height": 0.93, + "draught_proofed": "true", + "window_location": 0, + "window_wall_type": 1, + "permanent_shutters_present": "N", + "permanent_shutters_insulated": "N" + }, + { + "pvc_frame": "true", + "orientation": 6, + "window_type": 1, + "glazing_type": 2, + "window_width": 0.4, + "window_height": 0.74, + "draught_proofed": "true", + "window_location": 0, + "window_wall_type": 1, + "permanent_shutters_present": "N", + "permanent_shutters_insulated": "N" + }, + { + "pvc_frame": "true", + "orientation": 6, + "window_type": 1, + "glazing_type": 2, + "window_width": 1.49, + "window_height": 1.99, + "draught_proofed": "true", + "window_location": 0, + "window_wall_type": 1, + "permanent_shutters_present": "N", + "permanent_shutters_insulated": "N" + }, + { + "pvc_frame": "true", + "orientation": 6, + "window_type": 1, + "glazing_type": 2, + "window_width": 1.13, + "window_height": 1.06, + "draught_proofed": "true", + "window_location": 0, + "window_wall_type": 1, + "permanent_shutters_present": "N", + "permanent_shutters_insulated": "N" + }, + { + "pvc_frame": "true", + "orientation": 6, + "window_type": 1, + "glazing_type": 2, + "window_width": 0.17, + "window_height": 0.75, + "draught_proofed": "true", + "window_location": 0, + "window_wall_type": 1, + "permanent_shutters_present": "N", + "permanent_shutters_insulated": "N" + }, + { + "pvc_frame": "true", + "orientation": 6, + "window_type": 1, + "glazing_type": 2, + "window_width": 0.92, + "window_height": 0.94, + "draught_proofed": "true", + "window_location": 0, + "window_wall_type": 1, + "permanent_shutters_present": "N", + "permanent_shutters_insulated": "N" + }, + { + "pvc_frame": "true", + "orientation": 8, + "window_type": 1, + "glazing_type": 2, + "window_width": 1.01, + "window_height": 1.21, + "draught_proofed": "true", + "window_location": 0, + "window_wall_type": 1, + "permanent_shutters_present": "N", + "permanent_shutters_insulated": "N" + }, + { + "pvc_frame": "true", + "orientation": 8, + "window_type": 1, + "glazing_type": 2, + "window_width": 0.41, + "window_height": 0.85, + "draught_proofed": "true", + "window_location": 0, + "window_wall_type": 1, + "permanent_shutters_present": "N", + "permanent_shutters_insulated": "N" + }, + { + "pvc_frame": "true", + "orientation": 2, + "window_type": 1, + "glazing_type": 2, + "window_width": 1.03, + "window_height": 1.26, + "draught_proofed": "true", + "window_location": 0, + "window_wall_type": 1, + "permanent_shutters_present": "N", + "permanent_shutters_insulated": "N" + }, + { + "pvc_frame": "true", + "orientation": 2, + "window_type": 1, + "glazing_type": 2, + "window_width": 1.12, + "window_height": 0.92, + "draught_proofed": "true", + "window_location": 0, + "window_wall_type": 1, + "permanent_shutters_present": "N", + "permanent_shutters_insulated": "N" + }, + { + "pvc_frame": "true", + "orientation": 2, + "window_type": 1, + "glazing_type": 2, + "window_width": 1.63, + "window_height": 0.98, + "draught_proofed": "true", + "window_location": 1, + "window_wall_type": 1, + "permanent_shutters_present": "N", + "permanent_shutters_insulated": "N" + }, + { + "pvc_frame": "true", + "orientation": 2, + "window_type": 1, + "glazing_type": 2, + "window_width": 2.64, + "window_height": 1.2, + "draught_proofed": "true", + "window_location": 1, + "window_wall_type": 1, + "permanent_shutters_present": "N", + "permanent_shutters_insulated": "N" + }, + { + "pvc_frame": "true", + "orientation": 2, + "window_type": 1, + "glazing_type": 2, + "window_width": 0.55, + "window_height": 1.22, + "draught_proofed": "true", + "window_location": 1, + "window_wall_type": 1, + "permanent_shutters_present": "N", + "permanent_shutters_insulated": "N" + } + ], + "schema_type": "RdSAP-Schema-21.0.1", + "uprn_source": "Energy Assessor", + "country_code": "ENG", + "main_heating": [ + { + "description": "Boiler and radiators, mains gas", + "energy_efficiency_rating": 4, + "environmental_efficiency_rating": 4 + } + ], + "air_tightness": { + "description": "(not tested)", + "energy_efficiency_rating": 0, + "environmental_efficiency_rating": 0 + }, + "dwelling_type": "Semi-detached house", + "language_code": 1, + "pressure_test": 4, + "property_type": 0, + "address_line_1": "75 Kenworthy Lane", + "assessment_type": "RdSAP", + "completion_date": "2026-06-03", + "inspection_date": "2026-06-03", + "extensions_count": 1, + "measurement_type": 1, + "total_floor_area": 83, + "transaction_type": 5, + "conservatory_type": 1, + "heated_room_count": 5, + "registration_date": "2026-06-03", + "sap_energy_source": { + "mains_gas": "Y", + "meter_type": 2, + "pv_connection": 0, + "photovoltaic_supply": { + "none_or_no_details": { + "percent_roof_area": 0 + } + }, + "wind_turbines_count": 0, + "gas_smart_meter_present": "false", + "is_dwelling_export_capable": "false", + "wind_turbines_terrain_type": 2, + "electricity_smart_meter_present": "false" + }, + "secondary_heating": { + "description": "Room heaters, electric", + "energy_efficiency_rating": 0, + "environmental_efficiency_rating": 0 + }, + "extract_fans_count": 2, + "sap_building_parts": [ + { + "identifier": "Main Dwelling", + "wall_dry_lined": "N", + "wall_thickness": 300, + "floor_heat_loss": 7, + "roof_construction": 4, + "wall_construction": 4, + "building_part_number": 1, + "sap_floor_dimensions": [ + { + "floor": 0, + "room_height": { + "value": 2.43, + "quantity": "metres" + }, + "floor_insulation": 1, + "total_floor_area": { + "value": 35.07, + "quantity": "square metres" + }, + "party_wall_length": { + "value": 4.29, + "quantity": "metres" + }, + "floor_construction": 2, + "heat_loss_perimeter": { + "value": 11.12, + "quantity": "metres" + } + }, + { + "floor": 1, + "room_height": { + "value": 2.45, + "quantity": "metres" + }, + "total_floor_area": { + "value": 35.67, + "quantity": "square metres" + }, + "party_wall_length": { + "value": 4.84, + "quantity": "metres" + }, + "heat_loss_perimeter": { + "value": 12.21, + "quantity": "metres" + } + } + ], + "wall_insulation_type": 2, + "construction_age_band": "C", + "party_wall_construction": 0, + "wall_thickness_measured": "Y", + "roof_insulation_location": 2, + "roof_insulation_thickness": "100mm", + "wall_insulation_thickness": "NI", + "floor_insulation_thickness": "NI" + }, + { + "identifier": "Extension 1", + "wall_dry_lined": "N", + "wall_thickness": 300, + "floor_heat_loss": 7, + "roof_construction": 5, + "wall_construction": 4, + "building_part_number": 2, + "sap_floor_dimensions": [ + { + "floor": 0, + "room_height": { + "value": 2.43, + "quantity": "metres" + }, + "floor_insulation": 1, + "total_floor_area": { + "value": 6.07, + "quantity": "square metres" + }, + "party_wall_length": { + "value": 1.2, + "quantity": "metres" + }, + "floor_construction": 2, + "heat_loss_perimeter": { + "value": 6.26, + "quantity": "metres" + } + }, + { + "floor": 1, + "room_height": { + "value": 2.45, + "quantity": "metres" + }, + "total_floor_area": { + "value": 6.07, + "quantity": "square metres" + }, + "party_wall_length": { + "value": 1.2, + "quantity": "metres" + }, + "heat_loss_perimeter": { + "value": 6.26, + "quantity": "metres" + } + } + ], + "wall_insulation_type": 2, + "construction_age_band": "C", + "party_wall_construction": 0, + "wall_thickness_measured": "Y", + "roof_insulation_location": 4, + "roof_insulation_thickness": "ND", + "wall_insulation_thickness": "NI", + "floor_insulation_thickness": "NI" + } + ], + "solar_water_heating": "N", + "habitable_room_count": 5, + "heating_cost_current": { + "value": 1013, + "currency": "GBP" + }, + "insulated_door_count": 0, + "co2_emissions_current": 2.4, + "energy_rating_average": 60, + "energy_rating_current": 66, + "lighting_cost_current": { + "value": 53, + "currency": "GBP" + }, + "main_heating_controls": [ + { + "description": "Programmer, room thermostat and TRVs", + "energy_efficiency_rating": 4, + "environmental_efficiency_rating": 4 + } + ], + "has_hot_water_cylinder": "false", + "heating_cost_potential": { + "value": 926, + "currency": "GBP" + }, + "hot_water_cost_current": { + "value": 292, + "currency": "GBP" + }, + "mechanical_ventilation": 0, + "percent_draughtproofed": 100, + "suggested_improvements": [ + { + "sequence": 1, + "typical_saving": { + "value": 87, + "currency": "GBP" + }, + "indicative_cost": "\u00a35,000 - \u00a310,000", + "improvement_type": "W1", + "improvement_details": { + "improvement_number": 57 + }, + "improvement_category": 5, + "energy_performance_rating": 68, + "environmental_impact_rating": 75 + }, + { + "sequence": 2, + "typical_saving": { + "value": 224, + "currency": "GBP" + }, + "indicative_cost": "\u00a38,000 - \u00a310,000", + "improvement_type": "U", + "improvement_details": { + "improvement_number": 34 + }, + "improvement_category": 5, + "energy_performance_rating": 73, + "environmental_impact_rating": 76 + } + ], + "co2_emissions_potential": 2.1, + "energy_rating_potential": 73, + "lighting_cost_potential": { + "value": 53, + "currency": "GBP" + }, + "schema_version_original": "21.0.1", + "hot_water_cost_potential": { + "value": 292, + "currency": "GBP" + }, + "renewable_heat_incentive": { + "water_heating": 2105.06, + "space_heating_existing_dwelling": 8424.88 + }, + "draughtproofed_door_count": 2, + "energy_consumption_current": 174, + "has_fixed_air_conditioning": "false", + "multiple_glazed_proportion": 100, + "calculation_software_version": "5.02r0344", + "energy_consumption_potential": 146, + "environmental_impact_current": 73, + "current_energy_efficiency_band": "D", + "environmental_impact_potential": 76, + "has_heated_separate_conservatory": "false", + "potential_energy_efficiency_band": "C", + "co2_emissions_current_per_floor_area": 29, + "low_energy_fixed_lighting_bulbs_count": 9, + "incandescent_fixed_lighting_bulbs_count": 0 +} \ No newline at end of file diff --git a/tests/domain/sap10_calculator/rdsap/test_golden_fixtures.py b/tests/domain/sap10_calculator/rdsap/test_golden_fixtures.py index 04ec0814..4bea5f15 100644 --- a/tests/domain/sap10_calculator/rdsap/test_golden_fixtures.py +++ b/tests/domain/sap10_calculator/rdsap/test_golden_fixtures.py @@ -666,6 +666,58 @@ _EXPECTATIONS: tuple[_GoldenExpectation, ...] = ( _GoldenExpectation(cert_number="9421-3045-3205-1646-6200", actual_sap=87, expected_sap_resid=+0, expected_pe_resid_kwh_per_m2=-0.3541, expected_co2_resid_tonnes_per_yr=-0.0046, notes="Cohort-2 baseline pin captured by S0380.69."), _GoldenExpectation(cert_number="9796-3058-6205-0346-9200", actual_sap=90, expected_sap_resid=+0, expected_pe_resid_kwh_per_m2=-0.3533, expected_co2_resid_tonnes_per_yr=-0.0013, notes="Cohort-2 baseline pin captured by S0380.69."), _GoldenExpectation(cert_number="9836-7525-9500-0575-1202", actual_sap=75, expected_sap_resid=+0, expected_pe_resid_kwh_per_m2=-0.1132, expected_co2_resid_tonnes_per_yr=+0.0011, notes="Cohort-2 baseline pin captured by S0380.69."), + + # ------------------------------------------------------------------ + # "with api 3" — 2 fresh API+Summary+worksheet triples cross-validated + # by S0380.218. Both fetched fresh from the GOV.UK EPB register, run + # through BOTH front-ends (`from_api_response` + `from_elmhurst_site_ + # notes`), and pinned against the dr87 worksheet. The two paths agree + # to <1e-4 on all four metrics (cross-mapper parity per + # [[feedback-cross-mapper-parity-via-cascade]]) AND reproduce the + # worksheet's (255) cost / (272) CO2 / (286) PE exactly — see the + # +0.0000 worksheet pins in `_WORKSHEET_PE_CO2`. The dropped-field + # audit on both fresh JSONs surfaced no new silently-dropped schema + # fields (only `created_at` metadata + the shower keys handled by + # `_normalize_shower_outlets`). The PE/CO2 residuals below are vs the + # integer-rounded lodged register (`energy_consumption_current` / + # `co2_emissions_current`); the worksheet pins are the load-bearing + # 1e-4 check. + # ------------------------------------------------------------------ + _GoldenExpectation( + cert_number="0340-2467-9260-2006-6521", + actual_sap=70, + expected_sap_resid=+0, + expected_pe_resid_kwh_per_m2=-0.4054, + expected_co2_resid_tonnes_per_yr=-0.0250, + notes=( + "Semi-detached house, TFA 107.26, mains-gas PCDB-listed boiler " + "(index 15709, no Table 4b code), no PV, 1 building part, 17 " + "windows. S0380.218 cross-validation: API path ≡ Summary path " + "to <1e-4 on SAP/cost/CO2/PE; cascade reproduces the dr87 " + "worksheet (255) cost 776.4295 / (272) CO2 2875.0498 / (286) PE " + "16474.5616 exactly (see `_WORKSHEET_PE_CO2`). Cascade SAP " + "integer 70 = lodged (resid +0); cont 70.1228. PE/CO2 resids " + "below are vs the integer-rounded lodged register." + ), + ), + _GoldenExpectation( + cert_number="5500-5070-0822-0201-3663", + actual_sap=66, + expected_sap_resid=+0, + expected_pe_resid_kwh_per_m2=-0.2909, + expected_co2_resid_tonnes_per_yr=+0.0235, + notes=( + "Semi-detached house + 1 extension, TFA 82.88, mains-gas " + "PCDB-listed boiler (index 17741, no Table 4b code), no PV, 2 " + "building parts, 13 windows. S0380.218 cross-validation: API " + "path ≡ Summary path to <1e-4 on SAP/cost/CO2/PE; cascade " + "reproduces the dr87 worksheet (255) cost 751.8295 / (272) CO2 " + "2423.4547 / (286) PE 14397.0118 exactly (see " + "`_WORKSHEET_PE_CO2`). Cascade SAP integer 66 = lodged (resid " + "+0); cont 65.5539. PE/CO2 resids below are vs the integer-" + "rounded lodged register." + ), + ), ) @@ -697,7 +749,8 @@ class _WorksheetPin: expected_co2_resid_kg: float -# The 47 worksheet-validated certs (9 ASHP + 38 cohort-2). calc ≡ +# The 49 worksheet-validated certs (9 ASHP + 38 cohort-2 + 2 "with api +# 3", the last pair added by S0380.218). calc ≡ # worksheet on BOTH PE and CO2 at <1e-4 across the ENTIRE cohort # (every expected_*_resid below is 0.0000) — the SAP 10.2 1e-4 # convergence target, met. Closed over two slices: @@ -722,6 +775,7 @@ _WORKSHEET_PE_CO2: tuple[_WorksheetPin, ...] = ( _WorksheetPin(cert_number="0320-2756-8640-2296-1101", ws_pe_kwh_per_m2=45.7367, ws_co2_kg_per_yr=430.2596, expected_pe_resid=+0.0000, expected_co2_resid_kg=+0.0000), _WorksheetPin(cert_number="0330-2249-8150-2326-4121", ws_pe_kwh_per_m2=199.4413, ws_co2_kg_per_yr=3066.3286, expected_pe_resid=+0.0000, expected_co2_resid_kg=+0.0000), _WorksheetPin(cert_number="0330-2257-3640-2196-3145", ws_pe_kwh_per_m2=66.2620, ws_co2_kg_per_yr=435.0043, expected_pe_resid=+0.0000, expected_co2_resid_kg=+0.0000), + _WorksheetPin(cert_number="0340-2467-9260-2006-6521", ws_pe_kwh_per_m2=153.5946, ws_co2_kg_per_yr=2875.0498, expected_pe_resid=+0.0000, expected_co2_resid_kg=+0.0000), _WorksheetPin(cert_number="0350-2968-2650-2796-5255", ws_pe_kwh_per_m2=55.7024, ws_co2_kg_per_yr=470.7988, expected_pe_resid=+0.0000, expected_co2_resid_kg=+0.0000), _WorksheetPin(cert_number="0360-2266-5650-2106-8285", ws_pe_kwh_per_m2=162.9804, ws_co2_kg_per_yr=2183.7720, expected_pe_resid=+0.0000, expected_co2_resid_kg=+0.0000), _WorksheetPin(cert_number="0380-2471-3250-2596-8761", ws_pe_kwh_per_m2=56.4872, ws_co2_kg_per_yr=292.5490, expected_pe_resid=+0.0000, expected_co2_resid_kg=+0.0000), @@ -747,6 +801,7 @@ _WORKSHEET_PE_CO2: tuple[_WorksheetPin, ...] = ( _WorksheetPin(cert_number="4536-5424-8600-0109-1226", ws_pe_kwh_per_m2=63.9133, ws_co2_kg_per_yr=494.6357, expected_pe_resid=+0.0000, expected_co2_resid_kg=+0.0000), _WorksheetPin(cert_number="4536-8325-3100-0409-1222", ws_pe_kwh_per_m2=181.7206, ws_co2_kg_per_yr=2109.2633, expected_pe_resid=+0.0000, expected_co2_resid_kg=+0.0000), _WorksheetPin(cert_number="4800-3992-0422-0599-3563", ws_pe_kwh_per_m2=66.4814, ws_co2_kg_per_yr=259.3652, expected_pe_resid=+0.0000, expected_co2_resid_kg=+0.0000), + _WorksheetPin(cert_number="5500-5070-0822-0201-3663", ws_pe_kwh_per_m2=173.7091, ws_co2_kg_per_yr=2423.4547, expected_pe_resid=+0.0000, expected_co2_resid_kg=+0.0000), _WorksheetPin(cert_number="6835-3920-2509-0933-5226", ws_pe_kwh_per_m2=224.4924, ws_co2_kg_per_yr=1476.3032, expected_pe_resid=+0.0000, expected_co2_resid_kg=+0.0000), _WorksheetPin(cert_number="7700-3362-0922-7022-3563", ws_pe_kwh_per_m2=196.5859, ws_co2_kg_per_yr=2321.5875, expected_pe_resid=+0.0000, expected_co2_resid_kg=+0.0000), _WorksheetPin(cert_number="7800-1501-0922-7127-3563", ws_pe_kwh_per_m2=172.9406, ws_co2_kg_per_yr=3144.0259, expected_pe_resid=+0.0000, expected_co2_resid_kg=+0.0000),