From 4e8735cf76abdf8cdcc90af8eb128002ec818225 Mon Sep 17 00:00:00 2001 From: Khalim Conn-Kowlessar Date: Tue, 20 Jun 2023 18:45:08 +0100 Subject: [PATCH] Added property age estimate --- model_data/recommendations/WallRecommendations.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/model_data/recommendations/WallRecommendations.py b/model_data/recommendations/WallRecommendations.py index 5269fa4d..7cad0cca 100644 --- a/model_data/recommendations/WallRecommendations.py +++ b/model_data/recommendations/WallRecommendations.py @@ -1,4 +1,5 @@ import pint +import re from model_data.Property import Property import pandas as pd @@ -134,6 +135,11 @@ class WallRecommendations: if self.property.full_sap_epc: return pd.to_datetime(self.property.full_sap_epc["lodgement-date"]).year + if self.property.data["construction-age-band"]: + # Take the upper limit + band = [int(x) for x in re.findall(r'\b\d{4}\b', self.property.data["construction-age-band"])] + return band[1] + raise NotImplementedError("Implement me!") def recommend(self):