From cc170e1fa3d7cfdbb138538b318581ee0df0d2b1 Mon Sep 17 00:00:00 2001 From: Khalim Conn-Kowlessar Date: Thu, 9 May 2024 16:32:22 +0100 Subject: [PATCH] set up vander elliot asset list --- .idea/Model.iml | 2 +- .idea/misc.xml | 2 +- backend/ml_models/Valuation.py | 11 +++ etl/customers/vander_elliot/pilot.py | 105 +++++++++++++++++++++++++++ 4 files changed, 118 insertions(+), 2 deletions(-) create mode 100644 etl/customers/vander_elliot/pilot.py diff --git a/.idea/Model.iml b/.idea/Model.iml index b0f9c00d..4413bb06 100644 --- a/.idea/Model.iml +++ b/.idea/Model.iml @@ -7,7 +7,7 @@ - + diff --git a/.idea/misc.xml b/.idea/misc.xml index 1122b380..6f308057 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -3,7 +3,7 @@ - + diff --git a/backend/ml_models/Valuation.py b/backend/ml_models/Valuation.py index 5c781979..cfd775e7 100644 --- a/backend/ml_models/Valuation.py +++ b/backend/ml_models/Valuation.py @@ -79,6 +79,17 @@ class PropertyValuation: 100070520130: 177_000, # Based on Zoopla 100070333957: 185_000, # Based on Zoopla 100070543258: 211_000, # Based on Zoopla + # Vander Elliot Pilot - search by going to https://www.zoopla.co.uk/property/uprn/{uprn}/ + 41018850: 104_000, # Based on Zoopla + 38237316: 74_000, # Based on Zoopla + 38237317: 74_000, # Based on Zoopla + 41052320: 70_000, # Based on Zoopla + 41052321: 70_000, # Based on Zoopla + 41052322: 38_000, # Based on Zoopla + 41222759: 38_000, # Based on Zoopla + 41222760: 46_000, # Based on Zoopla + 41222761: 270_000, # Based on Zoopla + 41212534: 38_000, # Based on Zoopla } # We base our valuation uplifts on a number of sources diff --git a/etl/customers/vander_elliot/pilot.py b/etl/customers/vander_elliot/pilot.py new file mode 100644 index 00000000..3c52869b --- /dev/null +++ b/etl/customers/vander_elliot/pilot.py @@ -0,0 +1,105 @@ +import pandas as pd +from utils.s3 import save_csv_to_s3 + +EPC_C_PORTFOLIO_ID = 78 +EPC_B_PORTFOLIO_ID = 79 +USER_ID = 8 + + +def app(): + """ + This code sets up the asset list for the 9 property portfolio for the pilot + :return: + """ + + asset_list = [ + { + "address": "79 Clare Road", + "postcode": "L20 9LZ", + "uprn": 41018850, # 3 bedroom property + }, + { + "address": "Flat 1, 29 Bedford Road", + "postcode": "L4 5PS", + "uprn": 38237316 # Single dewlling converted into two flats + }, + { + "address": "Flat 2, 29 Bedford Road", + "postcode": "L4 5PS", + "uprn": 38237317 # Single dewlling converted into two flats + }, + # 7 Flats above a domestic unit + { + "address": "Flat 1, 2 Linacre Lane", + "postcode": "L20 5AH", + "uprn": 41052320 + }, + { + "address": "Flat 2, 2 Linacre Lane", + "postcode": "L20 5AH", + "uprn": 41052321, + }, + { + "address": "Flat 3, 2 Linacre Lane", + "postcode": "L20 5AH", + "uprn": 41052322, + }, + { + "address": "Flat 4, 2 Linacre Lane", + "postcode": "L20 5AH", + "uprn": 41222759, + }, + { + "address": "Flat 1, 4 Linacre Lane", + "postcode": "L20 5AH", + "uprn": 41222760, + }, + { + "address": "Flat 2, 4 Linacre Lane", + "postcode": "L20 5AH", + "uprn": 41222761, + }, + { + "address": "Flat 3, 4 Linacre Lane", + "postcode": "L20 5AH", + "uprn": 41212534, + }, + ] + + asset_list = pd.DataFrame(asset_list) + + # Store the asset list in s3 + filename = f"{USER_ID}/{EPC_C_PORTFOLIO_ID}/pilot.csv" + save_csv_to_s3( + dataframe=asset_list, + bucket_name="retrofit-plan-inputs-dev", + file_name=filename + ) + + # EPC C portoflio + body = { + "portfolio_id": str(EPC_C_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) + + # EPC B portoflio + body = { + "portfolio_id": str(EPC_B_PORTFOLIO_ID), + "housing_type": "Private", + "goal": "Increase EPC", + "goal_value": "B", + "trigger_file_path": filename, + "already_installed_file_path": "", + "patches_file_path": "", + "non_invasive_recommendations_file_path": "", + "budget": None, + } + print(body)