mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-08 11:17:27 +00:00
created basic script to create windows portfolio
This commit is contained in:
parent
654a0715fa
commit
c5af2c23bb
1 changed files with 43 additions and 0 deletions
43
etl/testing_data/windows_portfolio.py
Normal file
43
etl/testing_data/windows_portfolio.py
Normal file
|
|
@ -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)
|
||||
Loading…
Add table
Reference in a new issue