diff --git a/recommendations/HeatingRecommender.py b/recommendations/HeatingRecommender.py index 64a2e285..8fbcec86 100644 --- a/recommendations/HeatingRecommender.py +++ b/recommendations/HeatingRecommender.py @@ -9,15 +9,6 @@ from recommendations.HeatingControlRecommender import HeatingControlRecommender class HeatingRecommender: - ASSUMED_ELECTRIC_HEATING = [ - "Portable electric heaters assumed for most rooms", - "No system present, electric heaters assumed" - ] - - ROOM_HEATERS_DESCRIPTIONS = [ - "Room heaters, mains gas", "Room heaters, electric", "Portable electric heaters assumed for most rooms", - ] - high_heat_retention_contols_desc = "Controls for high heat retention storage heaters" def __init__(self, property_instance: Property): @@ -62,7 +53,10 @@ class HeatingRecommender: # The property is using portable heaters and has access to gas mains has_room_heaters = ( - self.property.main_heating["clean_description"] in self.ROOM_HEATERS_DESCRIPTIONS and + ( + self.property.main_heating["has_room_heaters"] or + self.property.main_heating["has_portable_electric_heaters"] + ) and self.property.data["mains-gas-flag"] ) @@ -95,7 +89,7 @@ class HeatingRecommender: ("boiler_upgrade" in measures) ) - return is_valid, has_boiler + return is_valid, has_gas_boiler def recommend(self, has_cavity_or_loft_recommendations, phase=0, measures=None): """ @@ -138,14 +132,14 @@ class HeatingRecommender: # Recommend high heat retention storage heaters self.recommend_hhr_storage_heaters(phase=phase, system_change=True, heating_controls_only=False) - gas_boiler_suitable, has_boiler = self.is_boiler_upgrade_suitable( + gas_boiler_suitable, has_gas_boiler = self.is_boiler_upgrade_suitable( measures=measures, ashp_only_heating_recommendation=ashp_only_heating_recommendation ) if gas_boiler_suitable: # This indicates that the home previously did not have a boiler in place and so would require # an overhaul to the system - right now, this is all reasons, apart from if there is an existing boiler - system_change = not has_boiler + system_change = not has_gas_boiler exising_room_heaters = self.property.main_heating["clean_description"] in [ "Room heaters, electric", "Room heaters, mains gas" ] diff --git a/recommendations/tests/test_data/heating_recommendations_data.py b/recommendations/tests/test_data/heating_recommendations_data.py index 982eb280..c6751784 100644 --- a/recommendations/tests/test_data/heating_recommendations_data.py +++ b/recommendations/tests/test_data/heating_recommendations_data.py @@ -978,6 +978,52 @@ testing_examples = [ "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" + }, + { + "epc": { + 'lmk-key': '1125990659062017030307353552528423', 'address1': '3 Manor Farm Cottage', 'address2': 'Halse', + 'address3': None, 'postcode': 'NN13 6DY', 'building-reference-number': 2529522278, + 'current-energy-rating': 'F', 'potential-energy-rating': 'C', 'current-energy-efficiency': 29, + 'potential-energy-efficiency': 80, 'property-type': 'House', 'built-form': 'End-Terrace', + 'inspection-date': '2017-03-02', 'local-authority': 'E07000155', 'constituency': 'E14000942', + 'county': 'Northamptonshire', 'lodgement-date': '2017-03-03', 'transaction-type': 'rental (private)', + 'environment-impact-current': 26, 'environment-impact-potential': 74, 'energy-consumption-current': 511, + 'energy-consumption-potential': 130, 'co2-emissions-current': 8.0, 'co2-emiss-curr-per-floor-area': 108, + 'co2-emissions-potential': 2.2, 'lighting-cost-current': 84, 'lighting-cost-potential': 56, + 'heating-cost-current': 1333, 'heating-cost-potential': 498, 'hot-water-cost-current': 285, + 'hot-water-cost-potential': 144, 'total-floor-area': 74.0, 'energy-tariff': 'dual', 'mains-gas-flag': 'N', + 'floor-level': 'NODATA!', 'flat-top-storey': None, 'flat-storey-count': None, + 'main-heating-controls': 2601.0, + 'multi-glaze-proportion': 0.0, 'glazed-type': 'not defined', 'glazed-area': 'Normal', 'extension-count': 1, + 'number-habitable-rooms': 4, 'number-heated-rooms': 1, 'low-energy-lighting': 50, + 'number-open-fireplaces': 0, 'hotwater-description': 'Electric immersion, off-peak', + 'hot-water-energy-eff': 'Very Poor', 'hot-water-env-eff': 'Poor', + 'floor-description': 'Solid, no insulation (assumed)', 'floor-energy-eff': 'NO DATA!', + 'windows-description': 'Single glazed', 'windows-energy-eff': 'Very Poor', 'windows-env-eff': 'Very Poor', + 'walls-description': 'Sandstone or limestone, 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, 75 mm loft insulation', 'roof-energy-eff': 'Average', + 'roof-env-eff': 'Average', 'mainheat-description': 'Room heaters, dual fuel (mineral and wood)', + 'mainheat-energy-eff': 'Poor', '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 50% of fixed outlets', + 'lighting-energy-eff': 'Good', 'lighting-env-eff': 'Good', 'main-fuel': 'dual fuel - mineral + wood', + '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': '3 Manor Farm Cottage, Halse', + 'local-authority-label': 'South Northamptonshire', 'constituency-label': 'South Northamptonshire', + 'posttown': 'BRACKLEY', 'construction-age-band': 'England and Wales: before 1900', + 'lodgement-datetime': '2017-03-03 07:35:35', 'tenure': 'rental (private)', + 'fixed-lighting-outlets-count': None, 'low-energy-fixed-light-count': None, 'uprn': 10000460605, + 'uprn-source': 'Address Matched', 'sheating-energy-eff': None, 'sheating-env-eff': None + }, + "heating_recommendation_descriptions": [ + 'Install high heat retention electric storage heaters. Upgrade heating controls to High Heat Retention ' + 'Storage Heater Controls' + ], + "heating_controls_recommendation_descriptions": [], + "notes": "This is an end-terrace house, without mains gas connection, so all we recommend is HHR" } ] @@ -1034,7 +1080,8 @@ completed_descriptions = [ "Boiler and radiators, electric", "Boiler and radiators, dual fuel (mineral and wood)", "Boiler and radiators, coal", - "Boiler and radiators, smokeless fuel" + "Boiler and radiators, smokeless fuel", + "Boiler and radiators, wood pellets" ] portfolio = pd.read_excel( @@ -1049,7 +1096,7 @@ portfolio["lodgement-datetime"] = portfolio["lodgement-datetime"].astype(str) print(portfolio["mainheat-description"].value_counts()) eg = portfolio[ - (portfolio["mainheat-description"] == "Boiler and radiators, wood pellets") + (portfolio["mainheat-description"] == "Room heaters, dual fuel (mineral and wood)") ].sample(1) eg = eg.squeeze().to_dict() print(eg)