Added property age estimate

This commit is contained in:
Khalim Conn-Kowlessar 2023-06-20 18:45:08 +01:00
parent 4a67e7f222
commit 4e8735cf76

View file

@ -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):