increasing scope of attributes being detected by hotwater attributes:

This commit is contained in:
Khalim Conn-Kowlessar 2023-06-15 13:06:54 +01:00
parent 23269bd03e
commit cfdfa8581a
2 changed files with 16 additions and 4 deletions

View file

@ -40,13 +40,13 @@ def handler():
cleaner.clean()
# For testing:
from epc_data.attributes.MainFuelAttributes import MainFuelAttributes
from epc_data.attributes.HotWaterAttributes import HotWaterAttributes
from collections import Counter
count = Counter([x["main-fuel"] for x in data])
descriptions = {x["hotwater-description"] for x in data}
out = []
for description in descriptions:
res = MainFuelAttributes(description).process()
res = HotWaterAttributes(description).process()
out.append(
{
"original_description": description,

View file

@ -18,11 +18,18 @@ class HotWaterAttributes:
'community scheme',
]
THERMOSTAT_CHARACTERISTICS = [
'no cylinder thermostat',
]
HEATING_SCOPE = [
'water heating only',
]
OTHER_CHARACTERISTICS = [
'waste water heat recovery',
'plus solar',
'off-peak',
'no cylinder thermostat',
'flue gas heat recovery',
'standard tariff',
'chp',
@ -40,6 +47,8 @@ class HotWaterAttributes:
for keywords in [
self.HEATER_TYPES,
self.SYSTEM_TYPES,
self.THERMOSTAT_CHARACTERISTICS,
self.HEATING_SCOPE,
self.OTHER_CHARACTERISTICS,
self.NO_SYSTEM_PRESENT_KEYWORDS,
]
@ -53,7 +62,10 @@ class HotWaterAttributes:
result: Dict[str, Union[str, bool]] = {
"heater_type": find_keyword(self.description, self.HEATER_TYPES),
"system_type": find_keyword(self.description, self.SYSTEM_TYPES),
"characteristics": find_keyword(self.description, self.OTHER_CHARACTERISTICS),
"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])],
"no_system_present": find_keyword(self.description, self.NO_SYSTEM_PRESENT_KEYWORDS),
}