diff --git a/backend/epc_api/json_samples/real_life_examples/RdSAP-Schema-21.0.1/uprn_100051051866/epc.json b/backend/epc_api/json_samples/real_life_examples/RdSAP-Schema-21.0.1/uprn_100051051866/epc.json new file mode 100644 index 000000000..4e226b29f --- /dev/null +++ b/backend/epc_api/json_samples/real_life_examples/RdSAP-Schema-21.0.1/uprn_100051051866/epc.json @@ -0,0 +1,351 @@ +{ + "uprn": 100051051866, + "roofs": [ + { + "description": "Pitched, insulated (assumed)", + "energy_efficiency_rating": 4, + "environmental_efficiency_rating": 4 + } + ], + "walls": [ + { + "description": "Cavity wall, as built, insulated (assumed)", + "energy_efficiency_rating": 4, + "environmental_efficiency_rating": 4 + } + ], + "floors": [ + { + "description": "Suspended, limited insulation (assumed)", + "energy_efficiency_rating": 0, + "environmental_efficiency_rating": 0 + } + ], + "status": "entered", + "tenure": 1, + "window": { + "description": "Fully double glazed", + "energy_efficiency_rating": 3, + "environmental_efficiency_rating": 3 + }, + "addendum": { + "addendum_numbers": [ + 15 + ] + }, + "lighting": { + "description": "Excellent lighting efficiency", + "energy_efficiency_rating": 5, + "environmental_efficiency_rating": 5 + }, + "postcode": "S20 7NQ", + "hot_water": { + "description": "From main system", + "energy_efficiency_rating": 4, + "environmental_efficiency_rating": 4 + }, + "post_town": "SHEFFIELD", + "psv_count": 0, + "built_form": 1, + "created_at": "2026-05-18 17:37:45", + "door_count": 1, + "region_code": 11, + "report_type": 2, + "sap_heating": { + "number_baths": 1, + "cylinder_size": 2, + "shower_outlets": [ + { + "shower_wwhrs": 1, + "shower_outlet_type": 4 + } + ], + "number_baths_wwhrs": 0, + "water_heating_code": 901, + "water_heating_fuel": 26, + "cylinder_thermostat": "Y", + "main_heating_details": [ + { + "has_fghrs": "N", + "main_fuel_type": 26, + "boiler_flue_type": 2, + "fan_flue_present": "Y", + "heat_emitter_type": 1, + "emitter_temperature": 1, + "main_heating_number": 1, + "main_heating_control": 2104, + "main_heating_category": 2, + "main_heating_fraction": 1, + "sap_main_heating_code": 102, + "central_heating_pump_age": 0, + "main_heating_data_source": 2, + "main_heating_index_number": 18773 + } + ], + "immersion_heating_type": "NA", + "cylinder_insulation_type": 1, + "has_fixed_air_conditioning": "false", + "cylinder_insulation_thickness": 50 + }, + "sap_version": 10.2, + "sap_windows": [ + { + "pvc_frame": "true", + "orientation": 7, + "window_type": 1, + "glazing_type": 2, + "window_width": { + "value": 1.6, + "quantity": "m" + }, + "window_height": { + "value": 1.2, + "quantity": "m" + }, + "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": { + "value": 1.2, + "quantity": "m" + }, + "window_height": { + "value": 1.2, + "quantity": "m" + }, + "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": { + "value": 1.6, + "quantity": "m" + }, + "window_height": { + "value": 1.6, + "quantity": "m" + }, + "draught_proofed": "true", + "window_location": 0, + "window_wall_type": 1, + "permanent_shutters_present": "N", + "permanent_shutters_insulated": "N" + }, + { + "pvc_frame": "true", + "orientation": 3, + "window_type": 1, + "glazing_type": 2, + "window_width": { + "value": 1.6, + "quantity": "m" + }, + "window_height": { + "value": 1.2, + "quantity": "m" + }, + "draught_proofed": "true", + "window_location": 0, + "window_wall_type": 1, + "permanent_shutters_present": "N", + "permanent_shutters_insulated": "N" + }, + { + "pvc_frame": "true", + "orientation": 3, + "window_type": 1, + "glazing_type": 2, + "window_width": { + "value": 0.5, + "quantity": "m" + }, + "window_height": { + "value": 1.2, + "quantity": "m" + }, + "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": "Detached bungalow", + "language_code": 1, + "pressure_test": 4, + "property_type": 1, + "address_line_1": "3 Pentland Gardens", + "address_line_2": "Waterthorpe", + "assessment_type": "RdSAP", + "completion_date": "2026-05-18", + "inspection_date": "2026-05-18", + "extensions_count": 0, + "measurement_type": 1, + "open_flues_count": 0, + "total_floor_area": 60, + "transaction_type": 1, + "conservatory_type": 2, + "heated_room_count": 4, + "other_flues_count": 0, + "registration_date": "2026-05-18", + "sap_energy_source": { + "mains_gas": "Y", + "meter_type": 3, + "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": "None", + "energy_efficiency_rating": 0, + "environmental_efficiency_rating": 0 + }, + "closed_flues_count": 0, + "extract_fans_count": 0, + "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": 2.4, + "floor_insulation": 1, + "total_floor_area": 60, + "party_wall_length": 0, + "floor_construction": 2, + "heat_loss_perimeter": 32 + } + ], + "wall_insulation_type": 4, + "construction_age_band": "I", + "party_wall_construction": "NA", + "wall_thickness_measured": "Y", + "roof_insulation_location": 4, + "roof_insulation_thickness": "NI" + } + ], + "boilers_flues_count": 0, + "open_chimneys_count": 0, + "solar_water_heating": "N", + "habitable_room_count": 4, + "heating_cost_current": { + "value": 701, + "currency": "GBP" + }, + "insulated_door_count": 0, + "co2_emissions_current": 2.3, + "energy_rating_average": 60, + "energy_rating_current": 70, + "lighting_cost_current": { + "value": 40, + "currency": "GBP" + }, + "main_heating_controls": [ + { + "description": "Programmer and room thermostat", + "energy_efficiency_rating": 3, + "environmental_efficiency_rating": 3 + } + ], + "blocked_chimneys_count": 0, + "has_hot_water_cylinder": "true", + "heating_cost_potential": { + "value": 701, + "currency": "GBP" + }, + "hot_water_cost_current": { + "value": 235, + "currency": "GBP" + }, + "mechanical_ventilation": 0, + "percent_draughtproofed": 100, + "schema_version_current": "LIG-21.0", + "suggested_improvements": [ + { + "sequence": 1, + "typical_saving": 238, + "indicative_cost": "\u00a38,000 - \u00a310,000", + "improvement_type": "U", + "improvement_details": { + "improvement_number": 34 + }, + "improvement_category": 5, + "energy_performance_rating": 82, + "environmental_impact_rating": 73 + } + ], + "co2_emissions_potential": 2.1, + "energy_rating_potential": 82, + "lighting_cost_potential": { + "value": 40, + "currency": "GBP" + }, + "schema_version_original": "LIG-21.0", + "hot_water_cost_potential": { + "value": 235, + "currency": "GBP" + }, + "renewable_heat_incentive": { + "water_heating": 2544.67, + "space_heating_existing_dwelling": 6292.1 + }, + "draughtproofed_door_count": 1, + "energy_consumption_current": 209, + "has_fixed_air_conditioning": "false", + "multiple_glazed_proportion": 100, + "calculation_software_version": "10.2.2.0", + "energy_consumption_potential": 185, + "environmental_impact_current": 70, + "cfl_fixed_lighting_bulbs_count": 0, + "current_energy_efficiency_band": "C", + "environmental_impact_potential": 73, + "led_fixed_lighting_bulbs_count": 8, + "has_heated_separate_conservatory": "false", + "potential_energy_efficiency_band": "B", + "co2_emissions_current_per_floor_area": 38, + "incandescent_fixed_lighting_bulbs_count": 0 +} \ No newline at end of file diff --git a/backend/epc_api/json_samples/real_life_examples/RdSAP-Schema-21.0.1/uprn_10070056075/epc.json b/backend/epc_api/json_samples/real_life_examples/RdSAP-Schema-21.0.1/uprn_10070056075/epc.json new file mode 100644 index 000000000..cc408d73d --- /dev/null +++ b/backend/epc_api/json_samples/real_life_examples/RdSAP-Schema-21.0.1/uprn_10070056075/epc.json @@ -0,0 +1,491 @@ +{ + "uprn": 10070056075, + "roofs": [ + { + "description": "Pitched, insulated", + "energy_efficiency_rating": 4, + "environmental_efficiency_rating": 4 + } + ], + "walls": [ + { + "description": "Cavity wall, as built, insulated (assumed)", + "energy_efficiency_rating": 4, + "environmental_efficiency_rating": 4 + } + ], + "floors": [ + { + "description": "Suspended, insulated (assumed)", + "energy_efficiency_rating": 0, + "environmental_efficiency_rating": 0 + } + ], + "status": "entered", + "tenure": 1, + "window": { + "description": "Fully double glazed", + "energy_efficiency_rating": 3, + "environmental_efficiency_rating": 3 + }, + "addendum": { + "addendum_numbers": [ + 15 + ] + }, + "lighting": { + "description": "Excellent lighting efficiency", + "energy_efficiency_rating": 5, + "environmental_efficiency_rating": 5 + }, + "postcode": "BD10 9UG", + "hot_water": { + "description": "From main system", + "energy_efficiency_rating": 4, + "environmental_efficiency_rating": 4 + }, + "post_town": "BRADFORD", + "psv_count": 0, + "built_form": 1, + "created_at": "2026-05-15 10:22:34", + "door_count": 1, + "region_code": 11, + "report_type": 2, + "sap_heating": { + "number_baths": 1, + "cylinder_size": 4, + "shower_outlets": [ + { + "shower_wwhrs": 1, + "shower_outlet_type": 4 + } + ], + "number_baths_wwhrs": 0, + "water_heating_code": 901, + "water_heating_fuel": 26, + "cylinder_thermostat": "Y", + "main_heating_details": [ + { + "has_fghrs": "N", + "main_fuel_type": 26, + "boiler_flue_type": 2, + "fan_flue_present": "Y", + "heat_emitter_type": 1, + "emitter_temperature": 1, + "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": 19012 + } + ], + "immersion_heating_type": "NA", + "cylinder_insulation_type": 1, + "has_fixed_air_conditioning": "false", + "cylinder_insulation_thickness": 80 + }, + "sap_version": 10.2, + "sap_windows": [ + { + "pvc_frame": "true", + "orientation": 5, + "window_type": 1, + "glazing_type": 2, + "window_width": { + "value": 1, + "quantity": "m" + }, + "window_height": { + "value": 1.2, + "quantity": "m" + }, + "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": { + "value": 1, + "quantity": "m" + }, + "window_height": { + "value": 1.2, + "quantity": "m" + }, + "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": { + "value": 1, + "quantity": "m" + }, + "window_height": { + "value": 1.2, + "quantity": "m" + }, + "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": { + "value": 1, + "quantity": "m" + }, + "window_height": { + "value": 1.2, + "quantity": "m" + }, + "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": { + "value": 1, + "quantity": "m" + }, + "window_height": { + "value": 1.2, + "quantity": "m" + }, + "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": { + "value": 1, + "quantity": "m" + }, + "window_height": { + "value": 1.2, + "quantity": "m" + }, + "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": { + "value": 1, + "quantity": "m" + }, + "window_height": { + "value": 1.2, + "quantity": "m" + }, + "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": { + "value": 1, + "quantity": "m" + }, + "window_height": { + "value": 1.2, + "quantity": "m" + }, + "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": { + "value": 1, + "quantity": "m" + }, + "window_height": { + "value": 1.2, + "quantity": "m" + }, + "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": { + "value": 1, + "quantity": "m" + }, + "window_height": { + "value": 1.2, + "quantity": "m" + }, + "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": { + "value": 1, + "quantity": "m" + }, + "window_height": { + "value": 1.2, + "quantity": "m" + }, + "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": { + "value": 1, + "quantity": "m" + }, + "window_height": { + "value": 1.2, + "quantity": "m" + }, + "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": "Detached house", + "language_code": 1, + "pressure_test": 4, + "property_type": 0, + "address_line_1": "36 Longlands", + "address_line_2": "Idle", + "assessment_type": "RdSAP", + "completion_date": "2026-05-15", + "inspection_date": "2026-05-08", + "extensions_count": 0, + "measurement_type": 1, + "open_flues_count": 0, + "total_floor_area": 139, + "transaction_type": 5, + "conservatory_type": 1, + "heated_room_count": 8, + "other_flues_count": 0, + "registration_date": "2026-05-15", + "sap_energy_source": { + "mains_gas": "Y", + "meter_type": 1, + "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": "None", + "energy_efficiency_rating": 0, + "environmental_efficiency_rating": 0 + }, + "closed_flues_count": 0, + "extract_fans_count": 0, + "sap_building_parts": [ + { + "identifier": "Main Dwelling", + "wall_dry_lined": "N", + "wall_thickness": 400, + "floor_heat_loss": 7, + "roof_construction": 8, + "wall_construction": 4, + "building_part_number": 1, + "sap_floor_dimensions": [ + { + "floor": 0, + "room_height": 2.3, + "floor_insulation": 1, + "total_floor_area": 69.6, + "party_wall_length": 0, + "floor_construction": 2, + "heat_loss_perimeter": 37.7 + }, + { + "floor": 1, + "room_height": 2.3, + "total_floor_area": 69.6, + "party_wall_length": 0, + "heat_loss_perimeter": 37.7 + } + ], + "wall_insulation_type": 4, + "construction_age_band": "K", + "party_wall_construction": "NA", + "wall_thickness_measured": "N", + "roof_insulation_location": 7, + "wall_insulation_thickness": "NI", + "sloping_ceiling_insulation_thickness": "AB" + } + ], + "boilers_flues_count": 0, + "open_chimneys_count": 0, + "solar_water_heating": "N", + "habitable_room_count": 8, + "heating_cost_current": { + "value": 938, + "currency": "GBP" + }, + "insulated_door_count": 0, + "co2_emissions_current": 3.0, + "energy_rating_average": 60, + "energy_rating_current": 80, + "lighting_cost_current": { + "value": 89, + "currency": "GBP" + }, + "main_heating_controls": [ + { + "description": "Programmer, room thermostat and TRVs", + "energy_efficiency_rating": 4, + "environmental_efficiency_rating": 4 + } + ], + "blocked_chimneys_count": 0, + "has_hot_water_cylinder": "true", + "heating_cost_potential": { + "value": 938, + "currency": "GBP" + }, + "hot_water_cost_current": { + "value": 236, + "currency": "GBP" + }, + "mechanical_ventilation": 0, + "percent_draughtproofed": 100, + "schema_version_current": "LIG-21.0", + "suggested_improvements": [ + { + "sequence": 1, + "typical_saving": 308, + "indicative_cost": "\u00a38,000 - \u00a310,000", + "improvement_type": "U", + "improvement_details": { + "improvement_number": 34 + }, + "improvement_category": 5, + "energy_performance_rating": 87, + "environmental_impact_rating": 81 + } + ], + "co2_emissions_potential": 2.8, + "energy_rating_potential": 87, + "lighting_cost_potential": { + "value": 89, + "currency": "GBP" + }, + "schema_version_original": "LIG-21.0", + "hot_water_cost_potential": { + "value": 236, + "currency": "GBP" + }, + "renewable_heat_incentive": { + "water_heating": 2744.25, + "space_heating_existing_dwelling": 9473.16 + }, + "draughtproofed_door_count": 1, + "energy_consumption_current": 117, + "has_fixed_air_conditioning": "false", + "multiple_glazed_proportion": 100, + "calculation_software_version": "10.2.2.0", + "energy_consumption_potential": 106, + "environmental_impact_current": 79, + "cfl_fixed_lighting_bulbs_count": 0, + "current_energy_efficiency_band": "C", + "environmental_impact_potential": 81, + "led_fixed_lighting_bulbs_count": 18, + "has_heated_separate_conservatory": "false", + "potential_energy_efficiency_band": "B", + "co2_emissions_current_per_floor_area": 21, + "incandescent_fixed_lighting_bulbs_count": 0 +} \ No newline at end of file diff --git a/tests/domain/sap10_calculator/test_real_cert_sap_accuracy.py b/tests/domain/sap10_calculator/test_real_cert_sap_accuracy.py index 21af95ba8..7d810b0ee 100644 --- a/tests/domain/sap10_calculator/test_real_cert_sap_accuracy.py +++ b/tests/domain/sap10_calculator/test_real_cert_sap_accuracy.py @@ -885,6 +885,37 @@ _EXPECTATIONS: Final[tuple[RealCertExpectation, ...]] = ( cert_num="uprn-100061275133", sap_score=77, ), + # UPRN 100051051866 (corpus; no cert number lodged). RdSAP-21.0.1 native — + # DETACHED BUNGALOW, band I, CAVITY wall as-built insulated, pitched + # insulated loft, SUSPENDED limited-insulation floor, mains-gas regular + # boiler + cylinder (size 2, insulation type 1, 50 mm — a properly + # insulated cylinder, so NOT the type-0/NULL zero-storage-loss bug), TFA 60. + # Lodged 70 / engine 71 (71.04). Reduced-field cavity fabric already + # Elmhurst-validated on sibling certs; the +1.04 is a cost-side residual + # (PE −13.6 kWh/m² under-count) with no fabric anomaly — walls 29.9, roof + # 15.6, floor 29.4, windows 15.6 W/K all register-explained. PINNED to the + # observed engine 71; the register data fully accounts for the engine output. + RealCertExpectation( + schema="RdSAP-Schema-21.0.1", + sample="uprn_100051051866", + cert_num="uprn-100051051866", + sap_score=71, + ), + # UPRN 10070056075 (corpus; no cert number lodged). RdSAP-21.0.1 native — + # DETACHED HOUSE, band K, CAVITY wall as-built insulated, pitched insulated + # loft, SUSPENDED insulated floor, mains-gas regular boiler + cylinder + # (size 4, insulation type 1, 80 mm — properly insulated), dual meter, + # TFA 139. Lodged 80 / engine 79 (78.99). Cavity fabric already + # Elmhurst-validated on sibling certs; the −1.01 is a cost-side residual + # (PE +5.4 kWh/m² over-count) with no fabric anomaly — walls 50.0, roof + # 20.1, floor 16.7, windows 26.7 W/K all register-explained. PINNED to the + # observed engine 79; the register data fully accounts for the engine output. + RealCertExpectation( + schema="RdSAP-Schema-21.0.1", + sample="uprn_10070056075", + cert_num="uprn-10070056075", + sap_score=79, + ), )