Fixing Hotwater attributes class and adding additional tests

This commit is contained in:
Khalim Conn-Kowlessar 2023-07-21 09:21:35 +01:00
parent 99ea438490
commit 07224393bc
2 changed files with 19 additions and 0 deletions

View file

@ -12,6 +12,7 @@ class HotWaterAttributes(BaseUtility):
# A device that transfers heat from a source (like the ground or air) into a building to provide hot water
'electric immersion', # An electric device that heats water using electric resistance
'gas boiler', # A boiler that uses gas as fuel to heat water
'oil boiler', # A boiler that uses oil as fuel to heat water
'electric instantaneous', # Similar to gas instantaneous, but uses electricity as its energy source
'gas multipoint', # A gas water heater that can supply hot water to multiple points of use at once
'heat pump' # A general category for heat pumps, regardless of the energy source
@ -89,11 +90,21 @@ class HotWaterAttributes(BaseUtility):
'from second main heating system': 'from secondary system',
}
WELSH_TEXT = {
"ogçör brif system": "from main system",
}
def __init__(self, description: str):
self.description: str = clean_description(description.lower())
self.nodata = not description or description in self.DATA_ANOMALY_MATCHES
translation = self.WELSH_TEXT.get(self.description)
if translation:
self.nodata = False
self.description = translation
if not any(
self._keyword_in_description(keywords)
for keywords in [

View file

@ -125,5 +125,13 @@ hotwater_cases = [
'system_type': 'from secondary system',
'thermostat_characteristics': None, 'heating_scope': None, 'energy_recovery': None, 'tariff_type': None,
'extra_features': None, 'chp_systems': None, 'distribution_system': None, 'no_system_present': None,
'assumed': False, "appliance": None},
{'original_description': 'OGÇÖr brif system', 'heater_type': None, 'system_type': 'from main system',
'thermostat_characteristics': None, 'heating_scope': None, 'energy_recovery': None, 'tariff_type': None,
'extra_features': None, 'chp_systems': None, 'distribution_system': None, 'no_system_present': None,
'assumed': False, "appliance": None},
{'original_description': 'Oil boiler/circulator', 'heater_type': None, 'system_type': 'oil boiler',
'thermostat_characteristics': None, 'heating_scope': None, 'energy_recovery': None, 'tariff_type': None,
'extra_features': None, 'chp_systems': None, 'distribution_system': 'circulator', 'no_system_present': None,
'assumed': False, "appliance": None}
]