From aa084a20df115811b8226a67c2660869dedf3daf Mon Sep 17 00:00:00 2001 From: Khalim Conn-Kowlessar Date: Thu, 15 Jun 2023 14:45:39 +0100 Subject: [PATCH] document component types --- epc_data/app.py | 2 +- epc_data/attributes/HotWaterAttributes.py | 73 +++++++++++++++++------ 2 files changed, 56 insertions(+), 19 deletions(-) diff --git a/epc_data/app.py b/epc_data/app.py index e30d1844..14771939 100644 --- a/epc_data/app.py +++ b/epc_data/app.py @@ -58,7 +58,7 @@ def handler(): df = df.reset_index(drop=True) import numpy as np - idx = 24 + idx = 27 record = df[df.index == idx].to_dict("records")[0] record = {k: v for k, v in record.items() if v not in [None, np.nan]} from pprint import pprint diff --git a/epc_data/attributes/HotWaterAttributes.py b/epc_data/attributes/HotWaterAttributes.py index 3e86d87f..2075f835 100644 --- a/epc_data/attributes/HotWaterAttributes.py +++ b/epc_data/attributes/HotWaterAttributes.py @@ -3,42 +3,73 @@ from epc_data.attributes.attribute_utils import clean_description, remove_punctu class HotWaterAttributes: + # HEATER_TYPES refer to the main devices used for heating water. These devices can be powered by different energy + # sources. HEATER_TYPES = [ - 'gas instantaneous', + 'gas instantaneous', # A water heater that provides hot water only as it is needed 'electric heat pump', - 'electric immersion', - 'gas boiler', - 'electric instantaneous', - 'gas multipoint', + # 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 + '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 ] + # SYSTEM_TYPES refer to the larger system within which the heater operates. SYSTEM_TYPES = [ - 'from main system', + 'from main system', # The hot water is provided by the main heating system of the building 'from secondary system', - 'community scheme', + # The hot water is provided by a secondary (or supplementary) heating system in the building + 'community scheme', # The hot water is provided by a community heating system ] + # THERMOSTAT_CHARACTERISTICS refer to features related to temperature control in the system. THERMOSTAT_CHARACTERISTICS = [ - 'no cylinder thermostat', + 'no cylinder thermostat', # Indicates that the hot water cylinder does not have a thermostat ] + # HEATING_SCOPE refers to the specific role of the heater in the heating system. HEATING_SCOPE = [ - 'water heating only', + 'water heating only', # Indicates that the heater is used only for water heating, not space heating ] - OTHER_CHARACTERISTICS = [ + # ENERGY_RECOVERY refers to systems or attributes that recover and utilize waste energy. + ENERGY_RECOVERY = [ 'waste water heat recovery', - 'plus solar', - 'off-peak', - 'flue gas heat recovery', - 'standard tariff', - 'chp', + # A system that recovers heat from waste hot water (e.g., from showers) to preheat incoming cold water + 'flue gas heat recovery', # A system that recovers heat from the flue gases of a boiler or furnace ] + # TARIFF_TYPE relates to the energy pricing structure or tariff that applies to the system. + TARIFF_TYPE = [ + 'standard tariff', # The energy used by the system is billed at a standard rate + 'off-peak', # The energy used by the system is primarily used during off-peak hours when rates are lower + ] + + # EXTRA_FEATURES are additional features or systems that enhance the efficiency or capability of the hot water + # system. + EXTRA_FEATURES = [ + 'plus solar', # Indicates that the system includes solar thermal panels to assist in water heating + ] + + # CHP_SYSTEMS is specifically for the Combined Heat and Power systems. + CHP_SYSTEMS = [ + 'chp', + # Combined Heat and Power system, a system that simultaneously produces heat and electricity from the same + # energy source + ] + + # NO_SYSTEM_PRESENT_KEYWORDS indicates there is no specific hot water system present. NO_SYSTEM_PRESENT_KEYWORDS = [ 'no system present', ] + # DISTRIBUTION_SYSTEM_KEYWORDS refers to components that assist in the distribution of the heated water. + DISTRIBUTION_SYSTEM_KEYWORDS = [ + 'circulator', # A pump used to circulate hot water in the system + ] + def __init__(self, description: str): self.description: str = clean_description(description.lower()) @@ -49,7 +80,10 @@ class HotWaterAttributes: self.SYSTEM_TYPES, self.THERMOSTAT_CHARACTERISTICS, self.HEATING_SCOPE, - self.OTHER_CHARACTERISTICS, + self.ENERGY_RECOVERY, + self.TARIFF_TYPE, + self.EXTRA_FEATURES, + self.CHP_SYSTEMS, self.NO_SYSTEM_PRESENT_KEYWORDS, ] ): @@ -64,8 +98,11 @@ class HotWaterAttributes: "system_type": find_keyword(self.description, self.SYSTEM_TYPES), "thermostat_characteristics": find_keyword(self.description, self.THERMOSTAT_CHARACTERISTICS), "heating_scope": find_keyword(self.description, self.HEATING_SCOPE), - "other_characteristics": [find_keyword(self.description, [keyword]) for keyword in - self.OTHER_CHARACTERISTICS if find_keyword(self.description, [keyword])], + "energy_recovery": find_keyword(self.description, self.ENERGY_RECOVERY), + "tariff_type": find_keyword(self.description, self.TARIFF_TYPE), + "extra_features": find_keyword(self.description, self.EXTRA_FEATURES), + "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), }