From 185406026666c12b37a29488edb5b47e9c3d9569 Mon Sep 17 00:00:00 2001 From: Khalim Conn-Kowlessar Date: Tue, 17 Sep 2024 10:27:51 +0100 Subject: [PATCH] added additional heating test case --- recommendations/HeatingRecommender.py | 5 +- .../test_data/heating_recommendations_data.py | 52 ++++++++++++++++++- 2 files changed, 55 insertions(+), 2 deletions(-) diff --git a/recommendations/HeatingRecommender.py b/recommendations/HeatingRecommender.py index db83508b..e4107205 100644 --- a/recommendations/HeatingRecommender.py +++ b/recommendations/HeatingRecommender.py @@ -87,7 +87,10 @@ class HeatingRecommender: # We can also recommend hhr if the property doesn't have a mains has connection no_mains = not self.property.data["mains-gas-flag"] - hhr_suitable = no_mains or self.has_electric_heating_description + # If the property already has room heaters then we recommend HHR as an option since the home already has + # a variation of room heaters + + hhr_suitable = no_mains or self.has_electric_heating_description or self.has_room_heaters return ( hhr_suitable and (not ashp_only_heating_recommendation) and not self.has_ashp and diff --git a/recommendations/tests/test_data/heating_recommendations_data.py b/recommendations/tests/test_data/heating_recommendations_data.py index 77126c7b..58f3fad4 100644 --- a/recommendations/tests/test_data/heating_recommendations_data.py +++ b/recommendations/tests/test_data/heating_recommendations_data.py @@ -1217,6 +1217,55 @@ testing_examples = [ "heating_controls_recommendation_descriptions": [], "notes": "This property has anthracite heating without mains. " "We recommend ASHP and HHR, but no gas condensing boiler" + }, + { + "epc": { + 'lmk-key': '298ecac47f69461257e582e9dd78cb4c8bbb8c05bee1af1530f052134ecd5044', 'address1': '9 HENDON RISE', + 'address2': None, 'address3': None, 'postcode': 'NG3 3AN', 'building-reference-number': 10001202381, + 'current-energy-rating': 'G', 'potential-energy-rating': 'D', 'current-energy-efficiency': 12, + 'potential-energy-efficiency': 66, 'property-type': 'House', 'built-form': 'Mid-Terrace', + 'inspection-date': '2021-03-31', 'local-authority': 'E06000018', 'constituency': 'E14000865', + 'county': None, + 'lodgement-date': '2021-05-27', 'transaction-type': 'rental', 'environment-impact-current': 15, + 'environment-impact-potential': 59, 'energy-consumption-current': 630, 'energy-consumption-potential': 187, + 'co2-emissions-current': 11.0, 'co2-emiss-curr-per-floor-area': 122, 'co2-emissions-potential': 3.6, + 'lighting-cost-current': 99, 'lighting-cost-potential': 99, 'heating-cost-current': 2107, + 'heating-cost-potential': 860, 'hot-water-cost-current': 458, 'hot-water-cost-potential': 73, + 'total-floor-area': 91.0, 'energy-tariff': 'Single', 'mains-gas-flag': 'Y', 'floor-level': None, + 'flat-top-storey': None, 'flat-storey-count': None, 'main-heating-controls': None, + 'multi-glaze-proportion': 100.0, 'glazed-type': 'double glazing installed before 2002', + 'glazed-area': 'Normal', 'extension-count': 1, 'number-habitable-rooms': 5, 'number-heated-rooms': 2, + 'low-energy-lighting': 63, 'number-open-fireplaces': 1, + 'hotwater-description': 'Electric immersion, standard tariff', 'hot-water-energy-eff': 'Very Poor', + 'hot-water-env-eff': 'Poor', 'floor-description': 'Suspended, no insulation (assumed)', + 'floor-energy-eff': None, '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': 'Portable electric heaters (assumed)', + 'roof-description': 'Pitched, no insulation (assumed)', 'roof-energy-eff': 'Very Poor', + 'roof-env-eff': 'Very Poor', + 'mainheat-description': 'Room heaters, mains gas, Room heaters, dual fuel (mineral and wood)', + 'mainheat-energy-eff': 'Average', 'mainheat-env-eff': 'Average', + 'mainheatcont-description': 'No thermostatic control of room temperature', 'mainheatc-energy-eff': 'Poor', + 'mainheatc-env-eff': 'Poor', 'lighting-description': 'Low energy lighting in 63% of fixed outlets', + 'lighting-energy-eff': 'Good', 'lighting-env-eff': 'Good', 'main-fuel': 'mains gas (not community)', + 'wind-turbine-count': 0, 'heat-loss-corridor': None, 'unheated-corridor-length': None, 'floor-height': 2.79, + 'photo-supply': 0.0, 'solar-water-heating-flag': 'N', 'mechanical-ventilation': 'natural', + 'address': '9 HENDON RISE', 'local-authority-label': 'Nottingham', 'constituency-label': 'Nottingham East', + 'posttown': 'NOTTINGHAM', 'construction-age-band': 'England and Wales: 1900-1929', + 'lodgement-datetime': '2021-05-27 13:52:20', 'tenure': 'Rented (private)', + 'fixed-lighting-outlets-count': 8.0, 'low-energy-fixed-light-count': None, 'uprn': 100031556691, + 'uprn-source': 'Energy Assessor', 'sheating-energy-eff': None, 'sheating-env-eff': None + }, + "heating_recommendation_descriptions": [ + 'Upgrade to a new condensing boiler Upgrade heating controls to Room thermostat, programmer and TRVs', + 'Upgrade to a new condensing boiler Upgrade heating controls to Smart Thermostats, room sensors and smart ' + 'radiator valves (time & temperature zone control)', + '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 room heaters with two different fuel sources" } ] @@ -1280,6 +1329,7 @@ completed_descriptions = [ "Portable electric heaters assumed for most rooms, Room heaters, electric", "Boiler and radiators, mains gas, Electric storage heaters", "Room heaters, anthracite", + "Room heaters, mains gas, Room heaters, dual fuel (mineral and wood)" ] portfolio = pd.read_excel( @@ -1294,7 +1344,7 @@ portfolio["lodgement-datetime"] = portfolio["lodgement-datetime"].astype(str) print(portfolio["mainheat-description"].value_counts()) eg = portfolio[ - (portfolio["mainheat-description"] == "Room heaters, anthracite") + (portfolio["mainheat-description"] == "Room heaters, mains gas, Room heaters, dual fuel (mineral and wood)") ].sample(1) eg = eg.squeeze().to_dict() print(eg)