Added additional heating unit test

This commit is contained in:
Khalim Conn-Kowlessar 2024-09-17 11:08:57 +01:00
parent 1854060266
commit 5243e64e41
2 changed files with 105 additions and 4 deletions

View file

@ -51,7 +51,9 @@ class HeatingRecommender:
self.heating_recommendations = []
self.heating_control_recommendations = []
self.has_electric_heating_description = self.property.main_heating["has_electric"]
self.has_electric_heating_description = (
self.property.main_heating["has_electric"] or self.property.main_heating["has_electricaire"]
)
self.has_ashp = self.property.main_heating["has_air_source_heat_pump"]
self.has_room_heaters = (
self.property.main_heating["has_room_heaters"] or

View file

@ -1265,7 +1265,105 @@ testing_examples = [
'Storage Heater Controls'
],
"heating_controls_recommendation_descriptions": [],
"notes": "This property has room heaters with two different fuel sources"
"notes": "This property has room heaters with two different fuel sources, so we recommend HHR, ASHP, and a "
"boiler upgrade"
},
{
"epc": {
'lmk-key': '717779210932011102812033766268396', 'address1': '28, Overdale Road', 'address2': None,
'address3': None, 'postcode': 'CV5 8AL', 'building-reference-number': 1616392968,
'current-energy-rating': 'F', 'potential-energy-rating': 'E', 'current-energy-efficiency': 28,
'potential-energy-efficiency': 40, 'property-type': 'Flat', 'built-form': 'NO DATA!',
'inspection-date': '2011-10-27', 'local-authority': 'E08000026', 'constituency': 'E14000650',
'county': None,
'lodgement-date': '2011-10-28', 'transaction-type': 'marketed sale', 'environment-impact-current': 37,
'environment-impact-potential': 47, 'energy-consumption-current': 544, 'energy-consumption-potential': 431,
'co2-emissions-current': 5.1, 'co2-emiss-curr-per-floor-area': 96, 'co2-emissions-potential': 4.0,
'lighting-cost-current': 54, 'lighting-cost-potential': 31, 'heating-cost-current': 576,
'heating-cost-potential': 711, 'hot-water-cost-current': 598, 'hot-water-cost-potential': 232,
'total-floor-area': 52.93, 'energy-tariff': 'Single', 'mains-gas-flag': 'N', 'floor-level': '1st',
'flat-top-storey': 'N', 'flat-storey-count': None, 'main-heating-controls': 2703.0,
'multi-glaze-proportion': 100.0, 'glazed-type': 'double glazing, unknown install date',
'glazed-area': 'Normal', 'extension-count': 0, 'number-habitable-rooms': 3, 'number-heated-rooms': 3,
'low-energy-lighting': 25, 'number-open-fireplaces': 0,
'hotwater-description': 'Electric immersion, standard tariff', 'hot-water-energy-eff': 'Very Poor',
'hot-water-env-eff': 'Very Poor', 'floor-description': '(other premises below)', 'floor-energy-eff': None,
'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': '(another dwelling above)',
'roof-energy-eff': None, 'roof-env-eff': None, 'mainheat-description': 'Electric underfloor heating',
'mainheat-energy-eff': 'Very Poor', 'mainheat-env-eff': 'Very Poor',
'mainheatcont-description': 'Room thermostat only', 'mainheatc-energy-eff': 'Poor',
'mainheatc-env-eff': 'Poor', 'lighting-description': 'Low energy lighting in 25% of fixed outlets',
'lighting-energy-eff': 'Average', 'lighting-env-eff': 'Average', 'main-fuel': 'electricity (not community)',
'wind-turbine-count': 0, 'heat-loss-corridor': 'unheated corridor', 'unheated-corridor-length': 4.44,
'floor-height': 2.28, 'photo-supply': 0.0, 'solar-water-heating-flag': None,
'mechanical-ventilation': 'natural', 'address': '28, Overdale Road', 'local-authority-label': 'Coventry',
'constituency-label': 'Coventry North West', 'posttown': 'COVENTRY',
'construction-age-band': 'England and Wales: 1950-1966', 'lodgement-datetime': '2011-10-28 12:03:37',
'tenure': 'owner-occupied', 'fixed-lighting-outlets-count': 8.0, 'low-energy-fixed-light-count': 2.0,
'uprn': 100070685908, '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 property is a flag, without mains gas connection. Currently has underfloor electric heating"
"so we recommend HHR"
},
{
"epc": {
'lmk-key': '800099229502014050214593392940598', 'address1': '16, Woodside', 'address2': None,
'address3': None, 'postcode': 'WV11 2PT', 'building-reference-number': 4556129968,
'current-energy-rating': 'F', 'potential-energy-rating': 'E', 'current-energy-efficiency': 21,
'potential-energy-efficiency': 39, 'property-type': 'House', 'built-form': 'Semi-Detached',
'inspection-date': '2014-05-01', 'local-authority': 'E08000031', 'constituency': 'E14001049',
'county': None,
'lodgement-date': '2014-05-02', 'transaction-type': 'none of the above', 'environment-impact-current': 32,
'environment-impact-potential': 46, 'energy-consumption-current': 479, 'energy-consumption-potential': 340,
'co2-emissions-current': 8.1, 'co2-emiss-curr-per-floor-area': 85, 'co2-emissions-potential': 5.7,
'lighting-cost-current': 111, 'lighting-cost-potential': 55, 'heating-cost-current': 2021,
'heating-cost-potential': 1655, 'hot-water-cost-current': 408, 'hot-water-cost-potential': 189,
'total-floor-area': 96.0, 'energy-tariff': 'Unknown', 'mains-gas-flag': 'Y', 'floor-level': 'NODATA!',
'flat-top-storey': None, 'flat-storey-count': None, 'main-heating-controls': 2504.0,
'multi-glaze-proportion': 100.0, 'glazed-type': 'double glazing installed before 2002',
'glazed-area': 'Normal', 'extension-count': 0, 'number-habitable-rooms': 5, 'number-heated-rooms': 5,
'low-energy-lighting': 0, 'number-open-fireplaces': 0,
'hotwater-description': 'Electric immersion, standard tariff', 'hot-water-energy-eff': 'Very Poor',
'hot-water-env-eff': 'Very Poor', 'floor-description': 'Solid, no insulation (assumed)',
'floor-energy-eff': None, 'windows-description': 'Fully double glazed', 'windows-energy-eff': 'Average',
'windows-env-eff': 'Average', 'walls-description': 'System built, as built, no insulation (assumed)',
'walls-energy-eff': 'Very Poor', 'walls-env-eff': 'Very Poor', 'secondheat-description': 'None',
'roof-description': 'Pitched, 200 mm loft insulation', 'roof-energy-eff': 'Good', 'roof-env-eff': 'Good',
'mainheat-description': 'Warm air, Electricaire', 'mainheat-energy-eff': 'Very Poor',
'mainheat-env-eff': 'Very Poor', 'mainheatcont-description': 'Programmer and room thermostat',
'mainheatc-energy-eff': 'Average', 'mainheatc-env-eff': 'Average',
'lighting-description': 'No low energy lighting', 'lighting-energy-eff': 'Very Poor',
'lighting-env-eff': 'Very Poor', 'main-fuel': 'electricity (not community)', 'wind-turbine-count': 0,
'heat-loss-corridor': 'NO DATA!', 'unheated-corridor-length': None, 'floor-height': None,
'photo-supply': 50.0, 'solar-water-heating-flag': None, 'mechanical-ventilation': 'natural',
'address': '16, Woodside', 'local-authority-label': 'Wolverhampton',
'constituency-label': 'Wolverhampton North East', 'posttown': 'WOLVERHAMPTON',
'construction-age-band': 'England and Wales: 1967-1975', 'lodgement-datetime': '2014-05-02 14:59:33',
'tenure': 'owner-occupied', 'fixed-lighting-outlets-count': 20.0, 'low-energy-fixed-light-count': 0.0,
'uprn': 100071209105, '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',
'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": "The property has warm air electricaire heating, so we recommend ASHP and HHR. It also has a mains"
"connection so we recommend a gas condensing boiler"
}
]
@ -1329,7 +1427,8 @@ 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)"
"Room heaters, mains gas, Room heaters, dual fuel (mineral and wood)",
"Electric underfloor heating",
]
portfolio = pd.read_excel(
@ -1344,7 +1443,7 @@ portfolio["lodgement-datetime"] = portfolio["lodgement-datetime"].astype(str)
print(portfolio["mainheat-description"].value_counts())
eg = portfolio[
(portfolio["mainheat-description"] == "Room heaters, mains gas, Room heaters, dual fuel (mineral and wood)")
(portfolio["mainheat-description"] == "Warm air, Electricaire")
].sample(1)
eg = eg.squeeze().to_dict()
print(eg)