From 02399667798370cab35608dc5edac17db7de1960 Mon Sep 17 00:00:00 2001 From: Khalim Conn-Kowlessar Date: Tue, 16 Apr 2024 11:32:15 +0100 Subject: [PATCH] setting up non-invasive recommendations --- etl/customers/immo/pilot/asset_list.py | 29 +++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/etl/customers/immo/pilot/asset_list.py b/etl/customers/immo/pilot/asset_list.py index e587cc25..614fa8a0 100644 --- a/etl/customers/immo/pilot/asset_list.py +++ b/etl/customers/immo/pilot/asset_list.py @@ -21,6 +21,7 @@ council_tax_bands = pd.DataFrame(council_tax_bands) # This is information we need to override on the EPC itself, for instance if a new survey has been conducted and # that has not reached the API +# For 53 Bromley, the non-invasives found the walls to be partially filled patches = [ { 'address': '6 Beech Road', 'postcode': 'DY1 4BP', @@ -42,7 +43,11 @@ patches = [ 'energy-consumption-current': '491', 'co2-emissions-current': '5.0', 'potential-energy-efficiency': '87' - } + }, + { + 'address': '53 Bromley', 'postcode': 'DY5 4PJ', + 'walls-description': 'Cavity wall, partial insulation', + }, ] # This is information that is found as a result of the non-invasives, that mean that certain measures @@ -56,6 +61,19 @@ already_installed = [ } ] +non_invasive_recommendations = [ + {'address': '8 Corporation Road', 'postcode': 'DY2 7PX', 'recommendations': []}, + {'address': '21 Wells Road', 'postcode': 'DY5 3TB', 'recommendations': ['cavity_extract_and_refill']}, + {'address': '27 Milton Road', 'postcode': 'WV14 8HZ', 'recommendations': ['cavity_extract_and_refill']}, + {'address': '195 Ashenhurst Road', 'postcode': 'DY1 2JB', 'recommendations': ['cavity_extract_and_refill']}, + {'address': '53 Bromley', 'postcode': 'DY5 4PJ', 'recommendations': ['cavity_surveyed_as_filled_is_partial']}, + {'address': '91 Osprey Drive', 'postcode': 'DY1 2JS', 'recommendations': ['cavity_extract_and_refill']}, + {'address': '47 Fairfield Road', 'postcode': 'DY8 5UJ', 'recommendations': ['cavity_extract_and_refill']}, + {'address': '150 Huntingtree Road', 'postcode': 'B63 4HP', 'recommendations': ['cavity_extract_and_refill']}, + {'address': '6 Beech Road', 'postcode': 'DY1 4BP', 'recommendations': []}, + {'address': '5 Oaklands', 'postcode': 'B62 0JA', 'recommendations': ['cavity_extract_and_refill']}, +] + def app(): raw_asset_list = read_excel_from_s3( @@ -102,6 +120,14 @@ def app(): file_name=patches_filename ) + # Store non-invasive recommendations in S3 + non_invasive_recommendations_filename = f"{USER_ID}/{PORTFOLIO_ID}/non_invasive_recommendations.json" + save_csv_to_s3( + dataframe=pd.DataFrame(non_invasive_recommendations), + bucket_name="retrofit-plan-inputs-dev", + file_name=non_invasive_recommendations_filename + ) + # EPC C portoflio body = { "portfolio_id": str(PORTFOLIO_ID), @@ -111,6 +137,7 @@ def app(): "trigger_file_path": filename, "already_installed_file_path": already_installed_filename, "patches_file_path": patches_filename, + "non_invasive_recommendations_file_path": non_invasive_recommendations_filename, "budget": None, } print(body)