From 36adaba8dbe1779782d748a56125bcbeb7409164 Mon Sep 17 00:00:00 2001 From: Khalim Conn-Kowlessar Date: Sat, 1 Jul 2023 17:14:19 +0100 Subject: [PATCH] Add gas range cooker hotwater system --- model_data/epc_attributes/FloorAttributes.py | 3 +- .../epc_attributes/HotWaterAttributes.py | 10 +++ .../test_hot_water_attributes_cases.py | 82 ++++++++++--------- 3 files changed, 57 insertions(+), 38 deletions(-) diff --git a/model_data/epc_attributes/FloorAttributes.py b/model_data/epc_attributes/FloorAttributes.py index c53e1627..b649cdd2 100644 --- a/model_data/epc_attributes/FloorAttributes.py +++ b/model_data/epc_attributes/FloorAttributes.py @@ -15,7 +15,8 @@ class FloorAttributes(BaseUtility): def __init__(self, description: str): self.description: str = description.lower() - self.nodata = not description or description in self.DATA_ANOMALY_MATCHES or description in self.OBSERVED_ERRORS + self.nodata = (not description) or (description in self.DATA_ANOMALY_MATCHES) or ( + description in self.OBSERVED_ERRORS) if not self.nodata and not any( rt in self.description for rt in diff --git a/model_data/epc_attributes/HotWaterAttributes.py b/model_data/epc_attributes/HotWaterAttributes.py index 20133f7b..760d12b1 100644 --- a/model_data/epc_attributes/HotWaterAttributes.py +++ b/model_data/epc_attributes/HotWaterAttributes.py @@ -76,6 +76,13 @@ class HotWaterAttributes(BaseUtility): 'assumed' ] + # in some rare instances, especially in older homes, a range cooker can be part of a larger system that also + # includes a boiler for heating water. In these cases, the cooker may help to heat the water, but this setup is + # not common, especially in modern homes. + APPLIANCE_SYSTEMS = [ + 'gas range cooker', # A gas-powered range cooker + ] + def __init__(self, description: str): self.description: str = clean_description(description.lower()) @@ -93,6 +100,7 @@ class HotWaterAttributes(BaseUtility): self.EXTRA_FEATURES, self.CHP_SYSTEMS, self.NO_SYSTEM_PRESENT_KEYWORDS, + self.APPLIANCE_SYSTEMS, ] ): raise ValueError('Invalid description') @@ -115,6 +123,7 @@ class HotWaterAttributes(BaseUtility): "distribution_system": None, "no_system_present": None, "assumed": None, + "appliance": None, } result: Dict[str, Union[str, bool]] = { @@ -128,6 +137,7 @@ class HotWaterAttributes(BaseUtility): "chp_systems": find_keyword(self.description, self.CHP_SYSTEMS), "distribution_system": find_keyword(self.description, self.DISTRIBUTION_SYSTEM_KEYWORDS), "no_system_present": find_keyword(self.description, self.NO_SYSTEM_PRESENT_KEYWORDS), + "appliance": find_keyword(self.description, self.APPLIANCE_SYSTEMS), } assumed_found = find_keyword(self.description, self.ASSUMED) diff --git a/model_data/tests/test_data/test_hot_water_attributes_cases.py b/model_data/tests/test_data/test_hot_water_attributes_cases.py index 9af019b5..e85f566a 100644 --- a/model_data/tests/test_data/test_hot_water_attributes_cases.py +++ b/model_data/tests/test_data/test_hot_water_attributes_cases.py @@ -2,115 +2,123 @@ hotwater_cases = [ {'original_description': 'Community scheme', 'heater_type': None, 'system_type': 'community scheme', '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}, + 'assumed': False, "appliance": None}, {'original_description': 'Community scheme with CHP', 'heater_type': None, 'system_type': 'community scheme', 'thermostat_characteristics': None, 'heating_scope': None, 'energy_recovery': None, 'tariff_type': None, 'extra_features': None, 'chp_systems': 'chp', 'distribution_system': None, 'no_system_present': None, - 'assumed': False}, {'original_description': 'Community scheme, no cylinder thermostat', 'heater_type': None, - 'system_type': 'community scheme', 'thermostat_characteristics': 'no cylinder thermostat', - 'heating_scope': None, 'energy_recovery': None, 'tariff_type': None, 'extra_features': None, - 'chp_systems': None, 'distribution_system': None, 'no_system_present': None, 'assumed': False}, + 'assumed': False, "appliance": None}, + {'original_description': 'Community scheme, no cylinder thermostat', 'heater_type': None, + 'system_type': 'community scheme', 'thermostat_characteristics': 'no cylinder thermostat', + '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': 'Community scheme, plus solar', 'heater_type': None, 'system_type': 'community scheme', 'thermostat_characteristics': None, 'heating_scope': None, 'energy_recovery': None, 'tariff_type': None, 'extra_features': 'plus solar', 'chp_systems': None, 'distribution_system': None, 'no_system_present': None, - 'assumed': False}, {'original_description': 'Community scheme, waste water heat recovery', 'heater_type': None, - 'system_type': 'community scheme', 'thermostat_characteristics': None, 'heating_scope': None, - 'energy_recovery': 'waste water heat recovery', 'tariff_type': None, 'extra_features': None, - 'chp_systems': None, 'distribution_system': None, 'no_system_present': None, 'assumed': False}, + 'assumed': False, "appliance": None}, + {'original_description': 'Community scheme, waste water heat recovery', 'heater_type': None, + 'system_type': 'community scheme', 'thermostat_characteristics': None, 'heating_scope': None, + 'energy_recovery': 'waste water heat recovery', 'tariff_type': None, 'extra_features': None, + 'chp_systems': None, 'distribution_system': None, 'no_system_present': None, 'assumed': False, "appliance": None}, {'original_description': 'Electric heat pump for water heating only', 'heater_type': 'electric heat pump', 'system_type': None, 'thermostat_characteristics': None, 'heating_scope': 'water heating only', 'energy_recovery': None, 'tariff_type': None, 'extra_features': None, 'chp_systems': None, - 'distribution_system': None, 'no_system_present': None, 'assumed': False}, + 'distribution_system': None, 'no_system_present': None, 'assumed': False, "appliance": None}, {'original_description': 'Electric heat pump for water heating only, no cylinder thermostat', 'heater_type': 'electric heat pump', 'system_type': None, 'thermostat_characteristics': 'no cylinder thermostat', 'heating_scope': 'water heating only', 'energy_recovery': None, 'tariff_type': None, 'extra_features': None, - 'chp_systems': None, 'distribution_system': None, 'no_system_present': None, 'assumed': False}, + 'chp_systems': None, 'distribution_system': None, 'no_system_present': None, 'assumed': False, "appliance": None}, {'original_description': 'Electric immersion, off-peak', 'heater_type': 'electric immersion', 'system_type': None, 'thermostat_characteristics': None, 'heating_scope': None, 'energy_recovery': None, 'tariff_type': 'off-peak', 'extra_features': None, 'chp_systems': None, 'distribution_system': None, 'no_system_present': None, - 'assumed': False}, + 'assumed': False, "appliance": None}, {'original_description': 'Electric immersion, off-peak, plus solar', 'heater_type': 'electric immersion', 'system_type': None, 'thermostat_characteristics': None, 'heating_scope': None, 'energy_recovery': None, 'tariff_type': 'off-peak', 'extra_features': 'plus solar', 'chp_systems': None, 'distribution_system': None, - 'no_system_present': None, 'assumed': False}, + 'no_system_present': None, 'assumed': False, "appliance": None}, {'original_description': 'Electric immersion, standard tariff', 'heater_type': 'electric immersion', 'system_type': None, 'thermostat_characteristics': None, 'heating_scope': None, 'energy_recovery': None, 'tariff_type': 'standard tariff', 'extra_features': None, 'chp_systems': None, 'distribution_system': None, - 'no_system_present': None, 'assumed': False}, + 'no_system_present': None, 'assumed': False, "appliance": None}, {'original_description': 'Electric immersion, standard tariff, flue gas heat recovery', 'heater_type': 'electric immersion', 'system_type': None, 'thermostat_characteristics': None, 'heating_scope': None, 'energy_recovery': 'flue gas heat recovery', 'tariff_type': 'standard tariff', 'extra_features': None, 'chp_systems': None, 'distribution_system': None, 'no_system_present': None, - 'assumed': False}, + 'assumed': False, "appliance": None}, {'original_description': 'Electric immersion, standard tariff, plus solar', 'heater_type': 'electric immersion', 'system_type': None, 'thermostat_characteristics': None, 'heating_scope': None, 'energy_recovery': None, 'tariff_type': 'standard tariff', 'extra_features': 'plus solar', 'chp_systems': None, 'distribution_system': None, - 'no_system_present': None, 'assumed': False}, + 'no_system_present': None, 'assumed': False, "appliance": None}, {'original_description': 'Electric immersion, standard tariff, waste water heat recovery', 'heater_type': 'electric immersion', 'system_type': None, 'thermostat_characteristics': None, 'heating_scope': None, 'energy_recovery': 'waste water heat recovery', 'tariff_type': 'standard tariff', 'extra_features': None, 'chp_systems': None, 'distribution_system': None, 'no_system_present': None, - 'assumed': False}, + 'assumed': False, "appliance": None}, {'original_description': 'Electric instantaneous at point of use', 'heater_type': 'electric instantaneous', 'system_type': None, '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}, + 'no_system_present': None, 'assumed': False, "appliance": None}, {'original_description': 'Electric instantaneous at point of use, waste water heat recovery', 'heater_type': 'electric instantaneous', 'system_type': None, 'thermostat_characteristics': None, 'heating_scope': None, 'energy_recovery': 'waste water heat recovery', 'tariff_type': None, 'extra_features': None, - 'chp_systems': None, 'distribution_system': None, 'no_system_present': None, 'assumed': False}, + 'chp_systems': None, 'distribution_system': None, 'no_system_present': None, 'assumed': False, "appliance": None}, {'original_description': 'From main 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}, {'original_description': 'From main system, flue gas heat recovery', 'heater_type': None, - 'system_type': 'from main system', 'thermostat_characteristics': None, 'heating_scope': None, - 'energy_recovery': 'flue gas heat recovery', 'tariff_type': None, 'extra_features': None, - 'chp_systems': None, 'distribution_system': None, 'no_system_present': None, 'assumed': False}, + 'assumed': False, "appliance": None}, + {'original_description': 'From main system, flue gas heat recovery', 'heater_type': None, + 'system_type': 'from main system', 'thermostat_characteristics': None, 'heating_scope': None, + 'energy_recovery': 'flue gas heat recovery', 'tariff_type': None, 'extra_features': None, + 'chp_systems': None, 'distribution_system': None, 'no_system_present': None, 'assumed': False, "appliance": None}, {'original_description': 'From main system, no cylinder thermostat', 'heater_type': None, 'system_type': 'from main system', 'thermostat_characteristics': 'no cylinder thermostat', 'heating_scope': None, 'energy_recovery': None, 'tariff_type': None, 'extra_features': None, 'chp_systems': None, - 'distribution_system': None, 'no_system_present': None, 'assumed': False}, + 'distribution_system': None, 'no_system_present': None, 'assumed': False, "appliance": None}, {'original_description': 'From main system, plus solar', 'heater_type': None, 'system_type': 'from main system', 'thermostat_characteristics': None, 'heating_scope': None, 'energy_recovery': None, 'tariff_type': None, 'extra_features': 'plus solar', 'chp_systems': None, 'distribution_system': None, 'no_system_present': None, - 'assumed': False}, + 'assumed': False, "appliance": None}, {'original_description': 'From main system, plus solar, waste water heat recovery', 'heater_type': None, 'system_type': 'from main system', 'thermostat_characteristics': None, 'heating_scope': None, 'energy_recovery': 'waste water heat recovery', 'tariff_type': None, 'extra_features': 'plus solar', - 'chp_systems': None, 'distribution_system': None, 'no_system_present': None, 'assumed': False}, + 'chp_systems': None, 'distribution_system': None, 'no_system_present': None, 'assumed': False, "appliance": None}, {'original_description': 'From main system, waste water heat recovery', 'heater_type': None, 'system_type': 'from main system', 'thermostat_characteristics': None, 'heating_scope': None, 'energy_recovery': 'waste water heat recovery', 'tariff_type': None, 'extra_features': None, 'chp_systems': None, - 'distribution_system': None, 'no_system_present': None, 'assumed': False}, + 'distribution_system': None, 'no_system_present': None, 'assumed': False, "appliance": None}, {'original_description': 'From secondary system', 'heater_type': None, '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}, {'original_description': 'From secondary system, no cylinder thermostat', 'heater_type': None, - 'system_type': 'from secondary system', 'thermostat_characteristics': 'no cylinder thermostat', - 'heating_scope': None, 'energy_recovery': None, 'tariff_type': None, 'extra_features': None, - 'chp_systems': None, 'distribution_system': None, 'no_system_present': None, 'assumed': False}, + 'assumed': False, "appliance": None}, + {'original_description': 'From secondary system, no cylinder thermostat', 'heater_type': None, + 'system_type': 'from secondary system', 'thermostat_characteristics': 'no cylinder thermostat', + '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': 'Gas boiler/circulator', 'heater_type': 'gas boiler', 'system_type': None, '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}, + 'assumed': False, "appliance": None}, {'original_description': 'Gas boiler/circulator, no cylinder thermostat', 'heater_type': 'gas boiler', 'system_type': None, 'thermostat_characteristics': 'no cylinder thermostat', 'heating_scope': None, 'energy_recovery': None, 'tariff_type': None, 'extra_features': None, 'chp_systems': None, - 'distribution_system': 'circulator', 'no_system_present': None, 'assumed': False}, + 'distribution_system': 'circulator', 'no_system_present': None, 'assumed': False, "appliance": None}, {'original_description': 'Gas instantaneous at point of use', 'heater_type': 'gas instantaneous', 'system_type': None, '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}, + 'no_system_present': None, 'assumed': False, "appliance": None}, {'original_description': 'Gas multipoint', 'heater_type': 'gas multipoint', 'system_type': None, '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}, + 'assumed': False, "appliance": None}, {'original_description': 'Heat pump, waste water heat recovery', 'heater_type': 'heat pump', 'system_type': None, 'thermostat_characteristics': None, 'heating_scope': None, 'energy_recovery': 'waste water heat recovery', 'tariff_type': None, 'extra_features': None, 'chp_systems': None, 'distribution_system': None, - 'no_system_present': None, 'assumed': False}, + 'no_system_present': None, 'assumed': False, "appliance": None}, {'original_description': 'No system present: electric immersion assumed', 'heater_type': 'electric immersion', 'system_type': None, 'thermostat_characteristics': None, 'heating_scope': None, 'energy_recovery': None, 'tariff_type': None, 'extra_features': None, 'chp_systems': None, 'distribution_system': None, - 'no_system_present': 'no system present', 'assumed': True} + 'no_system_present': 'no system present', 'assumed': True, "appliance": None}, + {'original_description': 'Gas range cooker', 'heater_type': None, 'system_type': None, + '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": "gas range cooker"} ]