From 4967ea1e66fec665090d8cf365c9b833f90d49b6 Mon Sep 17 00:00:00 2001 From: Khalim Conn-Kowlessar Date: Thu, 15 Jun 2023 14:54:24 +0100 Subject: [PATCH] hot water working nicely --- epc_data/app.py | 2 +- epc_data/attributes/HotWaterAttributes.py | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/epc_data/app.py b/epc_data/app.py index 14771939..3cbbbf37 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 = 27 + idx = 1 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 2075f835..56f3036e 100644 --- a/epc_data/attributes/HotWaterAttributes.py +++ b/epc_data/attributes/HotWaterAttributes.py @@ -70,6 +70,11 @@ class HotWaterAttributes: 'circulator', # A pump used to circulate hot water in the system ] + # Indicate if the information is assumed + ASSUMED = [ + 'assumed' + ] + def __init__(self, description: str): self.description: str = clean_description(description.lower()) @@ -106,4 +111,7 @@ class HotWaterAttributes: "no_system_present": find_keyword(self.description, self.NO_SYSTEM_PRESENT_KEYWORDS), } + assumed_found = find_keyword(self.description, self.ASSUMED) + result["assumed"] = True if assumed_found else False + return result