moved leds recommendations earlier

This commit is contained in:
Khalim Conn-Kowlessar 2024-09-27 17:10:04 +01:00
parent 0e8136d445
commit 32d702e930
2 changed files with 16 additions and 7 deletions

View file

@ -738,6 +738,7 @@ async def trigger_plan(body: PlanTriggerRequest):
{
"property_id": property_id,
"uprn": [p.uprn for p in input_properties if p.id == property_id][0],
"address": [p.address for p in input_properties if p.id == property_id][0],
"recommendation_id": rec["recommendation_id"],
"type": rec["type"],
"description": rec["description"],
@ -753,7 +754,9 @@ async def trigger_plan(body: PlanTriggerRequest):
10024087902, 121016121, 121016128
]
recommendation_impact_df = recommendation_impact_df[recommendation_impact_df["uprn"].isin(surveyed_uprns)]
recommendation_impact_df = recommendation_impact_df[recommendation_impact_df["type"] == "windows_glazing"]
# recommendation_impact_df = recommendation_impact_df[recommendation_impact_df["type"].isin(
# ["windows_glazing", "internal_wall_insulation"])
# ]
actual_impacts_df = pd.DataFrame(
[
@ -793,6 +796,12 @@ async def trigger_plan(body: PlanTriggerRequest):
actual_impacts_df, how="inner", on=["uprn", "type"]
)
property_recs = recommendation_impact_df[recommendation_impact_df["uprn"] == 121016128]
property = [p for p in input_properties if p.uprn == 121016128][0]
print(property.data["current-energy-efficiency"])
print(property_recs["sap_points"].sum())
property_recs["address"]
# from utils.s3 import read_dataframe_from_s3_parquet
# training_data = read_dataframe_from_s3_parquet(
# bucket_name="retrofit-data-dev",

View file

@ -157,6 +157,12 @@ class Recommendations:
property_recommendations.append(self.floor_recommender.recommendations)
phase += 1
if "low_energy_lighting" in measures:
self.lighting_recommender.recommend(phase=phase)
if self.lighting_recommender.recommendation:
property_recommendations.append(self.lighting_recommender.recommendation)
phase += 1
if "windows" in measures and "mixed_glazing" not in non_invasive_recommendation_types:
# If we have a mixed glazing recommendation, we prioritise this over the windows recommendation
self.windows_recommender.recommend(phase=phase)
@ -233,12 +239,6 @@ class Recommendations:
property_recommendations.append(self.hotwater_recommender.recommendations)
phase += 1
if "low_energy_lighting" in measures:
self.lighting_recommender.recommend(phase=phase)
if self.lighting_recommender.recommendation:
property_recommendations.append(self.lighting_recommender.recommendation)
phase += 1
if "secondary_heating" in measures:
self.secondary_heating_recommender.recommend(phase=phase)
if self.secondary_heating_recommender.recommendation: