From 64d19defbb7c3e6c9aff990ba533bffa26cfd787 Mon Sep 17 00:00:00 2001 From: Khalim Conn-Kowlessar Date: Mon, 16 Sep 2024 19:36:44 +0100 Subject: [PATCH] more heating tests --- .../test_data/heating_recommendations_data.py | 112 +++++++++++++++++- 1 file changed, 110 insertions(+), 2 deletions(-) diff --git a/recommendations/tests/test_data/heating_recommendations_data.py b/recommendations/tests/test_data/heating_recommendations_data.py index 2fc47e13..982eb280 100644 --- a/recommendations/tests/test_data/heating_recommendations_data.py +++ b/recommendations/tests/test_data/heating_recommendations_data.py @@ -876,6 +876,108 @@ testing_examples = [ "heating_controls_recommendation_descriptions": [], "notes": "This property has a coal boiler and no mains gas connection. We recommend ASHP and HHR, but" "no gas condensing boiler" + }, + { + "epc": { + 'lmk-key': '1139832199022019020816400153188351', 'address1': '1 Green Gates', 'address2': 'Bridstow', + 'address3': None, 'postcode': 'HR9 6QJ', 'building-reference-number': 5576913278, + 'current-energy-rating': 'F', 'potential-energy-rating': 'A', 'current-energy-efficiency': 37, + 'potential-energy-efficiency': 93, 'property-type': 'House', 'built-form': 'Semi-Detached', + 'inspection-date': '2019-02-08', 'local-authority': 'E06000019', 'constituency': 'E14000743', + 'county': None, + 'lodgement-date': '2019-02-08', 'transaction-type': 'ECO assessment', 'environment-impact-current': 11, + 'environment-impact-potential': 115, 'energy-consumption-current': 377, 'energy-consumption-potential': 28, + 'co2-emissions-current': 14.0, 'co2-emiss-curr-per-floor-area': 129, 'co2-emissions-potential': -1.9, + 'lighting-cost-current': 75, 'lighting-cost-potential': 75, 'heating-cost-current': 1512, + 'heating-cost-potential': 700, 'hot-water-cost-current': 258, 'hot-water-cost-potential': 113, + 'total-floor-area': 111.0, 'energy-tariff': 'Single', 'mains-gas-flag': 'N', 'floor-level': 'NODATA!', + 'flat-top-storey': None, 'flat-storey-count': None, 'main-heating-controls': 2101.0, + 'multi-glaze-proportion': 100.0, 'glazed-type': 'double glazing, unknown install date', + 'glazed-area': 'Normal', 'extension-count': 1, 'number-habitable-rooms': 5, 'number-heated-rooms': 5, + 'low-energy-lighting': 100, 'number-open-fireplaces': 0, 'hotwater-description': 'From main system', + 'hot-water-energy-eff': 'Average', 'hot-water-env-eff': 'Very Poor', + 'floor-description': 'Solid, no insulation (assumed)', 'floor-energy-eff': 'NO DATA!', + 'windows-description': 'Fully double glazed', 'windows-energy-eff': 'Average', 'windows-env-eff': 'Average', + 'walls-description': 'Cavity wall, as built, no insulation (assumed)', 'walls-energy-eff': 'Poor', + 'walls-env-eff': 'Poor', 'secondheat-description': 'None', + 'roof-description': 'Pitched, 270 mm loft insulation', 'roof-energy-eff': 'Good', 'roof-env-eff': 'Good', + 'mainheat-description': 'Boiler and radiators, smokeless fuel', 'mainheat-energy-eff': 'Poor', + 'mainheat-env-eff': 'Very Poor', + 'mainheatcont-description': 'No time or thermostatic control of room temperature', + 'mainheatc-energy-eff': 'Very Poor', 'mainheatc-env-eff': 'Very Poor', + 'lighting-description': 'Low energy lighting in all fixed outlets', 'lighting-energy-eff': 'Very Good', + 'lighting-env-eff': 'Very Good', 'main-fuel': 'smokeless coal', 'wind-turbine-count': 0, + 'heat-loss-corridor': 'NO DATA!', 'unheated-corridor-length': None, 'floor-height': None, + 'photo-supply': None, + 'solar-water-heating-flag': 'N', 'mechanical-ventilation': 'natural', 'address': '1 Green Gates, Bridstow', + 'local-authority-label': 'Herefordshire, County of', + 'constituency-label': 'Hereford and South Herefordshire', 'posttown': 'ROSS-ON-WYE', + 'construction-age-band': 'England and Wales: 1950-1966', + 'lodgement-datetime': '2019-02-08 16:40:01', 'tenure': 'rental (social)', + 'fixed-lighting-outlets-count': None, 'low-energy-fixed-light-count': None, 'uprn': 10007366417, + 'uprn-source': 'Address Matched', 'sheating-energy-eff': None, 'sheating-env-eff': None + }, + "heating_recommendation_descriptions": [ + 'Install an air source heat pump, and upgrade heating controls to Smart Thermostats, room sensors and ' + 'smart radiator valves (time & temperature zone control). The cost includes the £7500 boiler upgrade ' + 'scheme grant', + 'Install high heat retention electric storage heaters. Upgrade heating controls to High Heat Retention ' + 'Storage Heater Controls' + + ], + "heating_controls_recommendation_descriptions": [], + "notes": "This property has a smokeless fuel boiler and no mains gas connection. We recommend ASHP and HHR, but" + "no gas condensing boiler" + }, + { + "epc": { + 'lmk-key': '1253529329242015021115045635159198', 'address1': '143', 'address2': 'Shortheath', + 'address3': None, 'postcode': 'DE12 6BL', 'building-reference-number': 212621378, + 'current-energy-rating': 'F', 'potential-energy-rating': 'D', 'current-energy-efficiency': 22, + 'potential-energy-efficiency': 59, 'property-type': 'House', 'built-form': 'Semi-Detached', + 'inspection-date': '2015-02-11', 'local-authority': 'E07000039', 'constituency': 'E14000935', + 'county': 'Derbyshire', 'lodgement-date': '2015-02-11', 'transaction-type': 'RHI application', + 'environment-impact-current': 71, 'environment-impact-potential': 91, 'energy-consumption-current': 500, + 'energy-consumption-potential': 233, 'co2-emissions-current': 3.0, 'co2-emiss-curr-per-floor-area': 31, + 'co2-emissions-potential': 0.8, 'lighting-cost-current': 104, 'lighting-cost-potential': 59, + 'heating-cost-current': 1746, 'heating-cost-potential': 1010, 'hot-water-cost-current': 253, + 'hot-water-cost-potential': 151, 'total-floor-area': 96.0, 'energy-tariff': 'Single', 'mains-gas-flag': 'N', + 'floor-level': 'NODATA!', 'flat-top-storey': None, 'flat-storey-count': None, + 'main-heating-controls': 2111.0, + 'multi-glaze-proportion': 100.0, 'glazed-type': 'double glazing, unknown install date', + 'glazed-area': 'Normal', 'extension-count': 2, 'number-habitable-rooms': 5, 'number-heated-rooms': 5, + 'low-energy-lighting': 23, 'number-open-fireplaces': 1, 'hotwater-description': 'From main system', + 'hot-water-energy-eff': 'Poor', 'hot-water-env-eff': 'Very Good', + 'floor-description': 'Suspended, no insulation (assumed)', 'floor-energy-eff': 'NO DATA!', + 'windows-description': 'Fully double glazed', 'windows-energy-eff': 'Average', 'windows-env-eff': 'Average', + 'walls-description': 'Solid brick, as built, no insulation (assumed)', 'walls-energy-eff': 'Very Poor', + 'walls-env-eff': 'Very Poor', 'secondheat-description': 'Room heaters, dual fuel (mineral and wood)', + 'roof-description': 'Pitched, 250 mm loft insulation', 'roof-energy-eff': 'Good', 'roof-env-eff': 'Good', + 'mainheat-description': 'Boiler and radiators, wood pellets', 'mainheat-energy-eff': 'Poor', + 'mainheat-env-eff': 'Very Good', 'mainheatcont-description': 'TRVs and bypass', + 'mainheatc-energy-eff': 'Average', 'mainheatc-env-eff': 'Average', + 'lighting-description': 'Low energy lighting in 23% of fixed outlets', 'lighting-energy-eff': 'Poor', + 'lighting-env-eff': 'Poor', 'main-fuel': 'bulk wood pellets', 'wind-turbine-count': 0, + 'heat-loss-corridor': 'NO DATA!', 'unheated-corridor-length': None, 'floor-height': None, + 'photo-supply': None, + 'solar-water-heating-flag': 'N', 'mechanical-ventilation': 'natural', 'address': '143, Shortheath', + 'local-authority-label': 'South Derbyshire', 'constituency-label': 'South Derbyshire', + 'posttown': 'SWADLINCOTE', 'construction-age-band': 'England and Wales: 1900-1929', + 'lodgement-datetime': '2015-02-11 15:04:56', 'tenure': 'owner-occupied', + 'fixed-lighting-outlets-count': None, 'low-energy-fixed-light-count': None, 'uprn': 100030256931, + 'uprn-source': 'Address Matched', 'sheating-energy-eff': None, 'sheating-env-eff': None + }, + "heating_recommendation_descriptions": [ + 'Install an air source heat pump, and upgrade heating controls to Smart Thermostats, room sensors and ' + 'smart radiator valves (time & temperature zone control). The cost includes the £7500 boiler upgrade ' + 'scheme grant', + 'Install high heat retention electric storage heaters. Upgrade heating controls to High Heat Retention ' + 'Storage Heater Controls' + + ], + "heating_controls_recommendation_descriptions": [], + "notes": "This property has a wood pellets boiler and no mains gas connection. We recommend ASHP and HHR, but" + "no gas condensing boiler" } ] @@ -930,7 +1032,9 @@ completed_descriptions = [ "Electric storage heaters", "Boiler and radiators, LPG", "Boiler and radiators, electric", - "Boiler and radiators, dual fuel (mineral and wood)" + "Boiler and radiators, dual fuel (mineral and wood)", + "Boiler and radiators, coal", + "Boiler and radiators, smokeless fuel" ] portfolio = pd.read_excel( @@ -938,10 +1042,14 @@ portfolio = pd.read_excel( ) portfolio.columns = [c.replace("_", "-").lower() for c in portfolio.columns] portfolio = portfolio[~portfolio["mainheat-description"].isin(completed_descriptions)] +portfolio['sheating-energy-eff'] = None +portfolio['sheating-env-eff'] = None +portfolio["lodgement-datetime"] = portfolio["lodgement-datetime"].astype(str) + print(portfolio["mainheat-description"].value_counts()) eg = portfolio[ - (portfolio["mainheat-description"] == "Boiler and radiators, coal") + (portfolio["mainheat-description"] == "Boiler and radiators, wood pellets") ].sample(1) eg = eg.squeeze().to_dict() print(eg)