mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-08 11:17:27 +00:00
increasing scope of attributes being detected by hotwater attributes:
This commit is contained in:
parent
23269bd03e
commit
cfdfa8581a
2 changed files with 16 additions and 4 deletions
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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),
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue