mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-30 13:10:47 +00:00
started basic works
This commit is contained in:
parent
d4064da365
commit
8078f32fd4
2 changed files with 31 additions and 1 deletions
|
|
@ -868,7 +868,7 @@ class Property:
|
||||||
|
|
||||||
lodgement_date = self.data["lodgement-date"]
|
lodgement_date = self.data["lodgement-date"]
|
||||||
# We check if the lodgement date is more than 10 years old
|
# We check if the lodgement date is more than 10 years old
|
||||||
is_expired = (datetime.now() - pd.to_datetime(lodgement_date)) > timedelta(days=3650)
|
is_expired = self.epc_is_expired
|
||||||
|
|
||||||
# Handle re-baselining
|
# Handle re-baselining
|
||||||
co2_emissions = self.energy["co2_emissions"]
|
co2_emissions = self.energy["co2_emissions"]
|
||||||
|
|
@ -1499,3 +1499,13 @@ class Property:
|
||||||
]
|
]
|
||||||
|
|
||||||
return self.data.get("mechanical-ventilation") in ventilation_descriptions
|
return self.data.get("mechanical-ventilation") in ventilation_descriptions
|
||||||
|
|
||||||
|
@property
|
||||||
|
def epc_is_expired(self) -> bool:
|
||||||
|
"""
|
||||||
|
This property indicates that the EPC is expired. This is based on the lodgement date, where an EPC is
|
||||||
|
valid for 10 years.
|
||||||
|
:return: boolean indicating whether the EPC is expired
|
||||||
|
"""
|
||||||
|
lodgement_date = self.data["lodgement-date"]
|
||||||
|
return (datetime.now() - pd.to_datetime(lodgement_date)) > timedelta(days=3650)
|
||||||
|
|
|
||||||
|
|
@ -943,6 +943,26 @@ async def model_engine(body: PlanTriggerRequest):
|
||||||
# We also make a tweak - if the property has been flagged for solar but doesn't contain
|
# We also make a tweak - if the property has been flagged for solar but doesn't contain
|
||||||
# any panel performance, we ensure that we have a 3kWp and 4kWp option for the property
|
# any panel performance, we ensure that we have a 3kWp and 4kWp option for the property
|
||||||
|
|
||||||
|
# TODO: Temp - test re-baselining
|
||||||
|
p = input_properties[0]
|
||||||
|
p.create_base_difference_epc_record(cleaned_lookup=cleaned)
|
||||||
|
scoring_data = p.base_difference_record.df
|
||||||
|
# We just need a recent date to trigger the right models,
|
||||||
|
# as we are only interested in the deltas
|
||||||
|
scoring_data["is_post_sap10_starting"] = True
|
||||||
|
# Score model - SAP re-baselining model
|
||||||
|
model_api.MODEL_URLS["retrofit-sap-baseline-predictions"] = "sapbaselinemodel"
|
||||||
|
model_api.prediction_buckets["retrofit-sap-baseline-predictions"] = "retrofit-sap-baseline-predictions-dev"
|
||||||
|
example_response = model_api.predict_all(
|
||||||
|
df=scoring_data,
|
||||||
|
bucket=get_settings().DATA_BUCKET,
|
||||||
|
model_prefixes=["retrofit-sap-baseline-predictions"],
|
||||||
|
extract_ids=False
|
||||||
|
)
|
||||||
|
|
||||||
|
input_properties[0].data["current-energy-efficiency"] = 58.8
|
||||||
|
input_properties[0].data["current-energy-rating"] = "D"
|
||||||
|
|
||||||
logger.info("Identifying property recommendations")
|
logger.info("Identifying property recommendations")
|
||||||
recommendations, recommendations_scoring_data, representative_recommendations = {}, [], {}
|
recommendations, recommendations_scoring_data, representative_recommendations = {}, [], {}
|
||||||
for p in tqdm(input_properties):
|
for p in tqdm(input_properties):
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue