mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-30 13:10:47 +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()
|
cleaner.clean()
|
||||||
|
|
||||||
# For testing:
|
# For testing:
|
||||||
from epc_data.attributes.MainFuelAttributes import MainFuelAttributes
|
from epc_data.attributes.HotWaterAttributes import HotWaterAttributes
|
||||||
from collections import Counter
|
from collections import Counter
|
||||||
count = Counter([x["main-fuel"] for x in data])
|
count = Counter([x["main-fuel"] for x in data])
|
||||||
descriptions = {x["hotwater-description"] for x in data}
|
descriptions = {x["hotwater-description"] for x in data}
|
||||||
out = []
|
out = []
|
||||||
for description in descriptions:
|
for description in descriptions:
|
||||||
res = MainFuelAttributes(description).process()
|
res = HotWaterAttributes(description).process()
|
||||||
out.append(
|
out.append(
|
||||||
{
|
{
|
||||||
"original_description": description,
|
"original_description": description,
|
||||||
|
|
|
||||||
|
|
@ -18,11 +18,18 @@ class HotWaterAttributes:
|
||||||
'community scheme',
|
'community scheme',
|
||||||
]
|
]
|
||||||
|
|
||||||
|
THERMOSTAT_CHARACTERISTICS = [
|
||||||
|
'no cylinder thermostat',
|
||||||
|
]
|
||||||
|
|
||||||
|
HEATING_SCOPE = [
|
||||||
|
'water heating only',
|
||||||
|
]
|
||||||
|
|
||||||
OTHER_CHARACTERISTICS = [
|
OTHER_CHARACTERISTICS = [
|
||||||
'waste water heat recovery',
|
'waste water heat recovery',
|
||||||
'plus solar',
|
'plus solar',
|
||||||
'off-peak',
|
'off-peak',
|
||||||
'no cylinder thermostat',
|
|
||||||
'flue gas heat recovery',
|
'flue gas heat recovery',
|
||||||
'standard tariff',
|
'standard tariff',
|
||||||
'chp',
|
'chp',
|
||||||
|
|
@ -40,6 +47,8 @@ class HotWaterAttributes:
|
||||||
for keywords in [
|
for keywords in [
|
||||||
self.HEATER_TYPES,
|
self.HEATER_TYPES,
|
||||||
self.SYSTEM_TYPES,
|
self.SYSTEM_TYPES,
|
||||||
|
self.THERMOSTAT_CHARACTERISTICS,
|
||||||
|
self.HEATING_SCOPE,
|
||||||
self.OTHER_CHARACTERISTICS,
|
self.OTHER_CHARACTERISTICS,
|
||||||
self.NO_SYSTEM_PRESENT_KEYWORDS,
|
self.NO_SYSTEM_PRESENT_KEYWORDS,
|
||||||
]
|
]
|
||||||
|
|
@ -53,7 +62,10 @@ class HotWaterAttributes:
|
||||||
result: Dict[str, Union[str, bool]] = {
|
result: Dict[str, Union[str, bool]] = {
|
||||||
"heater_type": find_keyword(self.description, self.HEATER_TYPES),
|
"heater_type": find_keyword(self.description, self.HEATER_TYPES),
|
||||||
"system_type": find_keyword(self.description, self.SYSTEM_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),
|
"no_system_present": find_keyword(self.description, self.NO_SYSTEM_PRESENT_KEYWORDS),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue