mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-08 11:17:27 +00:00
got main fuel working - needs tests
This commit is contained in:
parent
6a48eea55c
commit
8e7c39a823
2 changed files with 9 additions and 2 deletions
|
|
@ -58,7 +58,7 @@ def handler():
|
|||
df = df.reset_index(drop=True)
|
||||
|
||||
import numpy as np
|
||||
idx = 14
|
||||
idx = 24
|
||||
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
|
||||
|
|
|
|||
|
|
@ -22,6 +22,10 @@ class MainFuelAttributes:
|
|||
'house coal'
|
||||
]
|
||||
|
||||
COMPLEX_FUEL_KEYWORDS = [
|
||||
'heat from boilers using biodiesel from any biomass source'
|
||||
]
|
||||
|
||||
TARIFF_KEYWORDS = [
|
||||
'unspecified tariff'
|
||||
# We may come across more later but this is all observed for now
|
||||
|
|
@ -45,7 +49,8 @@ class MainFuelAttributes:
|
|||
for keywords in [
|
||||
self.FUEL_KEYWORDS,
|
||||
self.NO_INDIVIDUAL_HEATING_OR_COMMUNITY_NETWORK,
|
||||
self.TARIFF_KEYWORDS
|
||||
self.TARIFF_KEYWORDS,
|
||||
self.COMPLEX_FUEL_KEYWORDS
|
||||
]
|
||||
):
|
||||
raise ValueError('Invalid description')
|
||||
|
|
@ -61,6 +66,8 @@ class MainFuelAttributes:
|
|||
"no_individual_heating_or_community_network": find_keyword(
|
||||
self.description, self.NO_INDIVIDUAL_HEATING_OR_COMMUNITY_NETWORK
|
||||
),
|
||||
"complex_fuel_type": find_keyword(self.description, self.COMPLEX_FUEL_KEYWORDS),
|
||||
|
||||
}
|
||||
|
||||
# to make this field palettable, if no_individual_heating_or_community_network is populated, we'll
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue