diff --git a/backend/Property.py b/backend/Property.py index 4ae65d7d..956dd586 100644 --- a/backend/Property.py +++ b/backend/Property.py @@ -351,7 +351,7 @@ class Property: if r["phase"] <= phase ] epc_transformations = [x["description_simulation"] for x in represenative_recs_to_this_phase] - + # It is possible that we could have two simulations applied to the same descriptions # We extract these out phase_epc_transformation = {} diff --git a/backend/app/plan/router.py b/backend/app/plan/router.py index 8e6bc3b1..3d2755c2 100644 --- a/backend/app/plan/router.py +++ b/backend/app/plan/router.py @@ -488,13 +488,6 @@ async def trigger_plan(body: PlanTriggerRequest): "carbon_ending"] ) - from utils.s3 import save_dataframe_to_s3_parquet - save_dataframe_to_s3_parquet( - bucket_name="retrofit-datalake-dev", - file_key="recommendations_scoring_data_11th_july.parquet", - df=recommendations_scoring_data - ) - model_api = ModelApi(portfolio_id=body.portfolio_id, timestamp=created_at) all_predictions = model_api.predictions_template() diff --git a/etl/sfr/example_retrofit_plan.py b/etl/sfr/example_retrofit_plan.py new file mode 100644 index 00000000..fd75cbe1 --- /dev/null +++ b/etl/sfr/example_retrofit_plan.py @@ -0,0 +1,37 @@ +import pandas as pd +from utils.s3 import save_csv_to_s3 + +PORTFOLIO_ID = 85 +USER_ID = 8 + + +def app(): + asset_list = [ + { + "address": "120 Yarningale Road", + "postcode": "B14 6NB", + "uprn": 100070575194 + } + ] + + asset_list = pd.DataFrame(asset_list) + + filename = f"{USER_ID}/{PORTFOLIO_ID}/sample.csv" + save_csv_to_s3( + dataframe=asset_list, + bucket_name="retrofit-plan-inputs-dev", + file_name=filename + ) + + body = { + "portfolio_id": str(PORTFOLIO_ID), + "housing_type": "Private", + "goal": "Increase EPC", + "goal_value": "C", + "trigger_file_path": filename, + "already_installed_file_path": "", + "patches_file_path": "", + "non_invasive_recommendations_file_path": "", + "budget": None, + } + print(body) diff --git a/recommendations/WallRecommendations.py b/recommendations/WallRecommendations.py index a1a1491b..448b34e8 100644 --- a/recommendations/WallRecommendations.py +++ b/recommendations/WallRecommendations.py @@ -524,6 +524,10 @@ class WallRecommendations(Definitions): "already_installed": already_installed, "sap_points": None, "simulation_config": simulation_config, + "description_simulation": { + "walls-description": new_description, + "walls-energy-eff": simulation_config["walls_energy_eff_ending"] + }, **cost_result } )