From c5af2c23bb1aa0a8a2ee34b65de0033ec0e70e18 Mon Sep 17 00:00:00 2001 From: Khalim Conn-Kowlessar Date: Wed, 20 Dec 2023 17:06:37 +0000 Subject: [PATCH] created basic script to create windows portfolio --- etl/testing_data/windows_portfolio.py | 43 +++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 etl/testing_data/windows_portfolio.py diff --git a/etl/testing_data/windows_portfolio.py b/etl/testing_data/windows_portfolio.py new file mode 100644 index 00000000..16b28c8f --- /dev/null +++ b/etl/testing_data/windows_portfolio.py @@ -0,0 +1,43 @@ +""" +This script will create an input csv for the recommendation engine and upload it to S3, which can be used for +testing +""" +import pandas as pd +from utils.s3 import save_csv_to_s3 + +USER_ID = 8 +PORTFOLIO_ID = 56 + + +def app(): + """ + This portfolio is for testing windows recommendations + :return: + """ + + test_file = pd.DataFrame( + [ + {"address": "3 Church Terrace", "postcode": "LE13 0PW", "Notes": None}, + {"address": "3, Main Street, Redmile", "postcode": "NG13 0GA", "Notes": None}, + {"address": "The Hollies Farm House, Church Walk, Little Dalby", "postcode": "LE14 2UQ", "Notes": None}, + {"address": "13 Main Street", "postcode": "LE14 2JU", "Notes": None}, + {"address": "8 The Crescent, Coston Road, Buckminster", "postcode": "NG33 5SF", "Notes": None}, + ] + ) + + # Store the data in s3 + filename = f"{USER_ID}/{PORTFOLIO_ID}/windows_portfolio_inputs.csv" + save_csv_to_s3( + dataframe=test_file, + bucket_name="retrofit-plan-inputs-dev", + file_name=filename + ) + + body = { + "portfolio_id": str(PORTFOLIO_ID), + "housing_type": "Social", + "goal": "Increase EPC", + "goal_value": "A", + "trigger_file_path": filename + } + print(body)