From 54e29a98dc9ab12f23545b3183327cfc697eb186 Mon Sep 17 00:00:00 2001 From: Khalim Conn-Kowlessar Date: Tue, 3 Sep 2024 18:32:44 +0100 Subject: [PATCH] set up structure for uploading retrofit assessments but not going to implement right now --- backend/app/energy_assessments/router.py | 2 ++ etl/xml_survey_extraction/app.py | 40 ++---------------------- 2 files changed, 4 insertions(+), 38 deletions(-) diff --git a/backend/app/energy_assessments/router.py b/backend/app/energy_assessments/router.py index 8a52bdfb..ec49c1c1 100644 --- a/backend/app/energy_assessments/router.py +++ b/backend/app/energy_assessments/router.py @@ -36,6 +36,8 @@ async def upload(body: EnergyAssessmentUploadPayload): Eventually, we will this service to collect the key documents from the service where they're uploaded (e.g. Onedrive) and store them to S3, but for the moment, this is sufficient + + # TODO - Holding up on implementing this """ logger.info("Connecting to db") diff --git a/etl/xml_survey_extraction/app.py b/etl/xml_survey_extraction/app.py index f5394abf..be39d0df 100644 --- a/etl/xml_survey_extraction/app.py +++ b/etl/xml_survey_extraction/app.py @@ -13,7 +13,7 @@ logger = setup_logger() BUCKET = "retrofit-energy-assessments-dev" USER_ID = 8 SCENARIOS = { - 86: { + 101: { "project_code": "VDE001", "surveyor": "JAFFERSONS ENERGY CONSULTANTS", "bodies": [ @@ -64,42 +64,6 @@ SCENARIOS = { } ] }, - 87: { - "project_code": "VDE002", - "surveyor": "JAFFERSONS ENERGY CONSULTANTS", - "bodies": [ - # Scenario A: Solar PV, AHSP - { - "portfolio_id": str(87), - "housing_type": "Private", - "goal": "Increasing EPC", - "goal_value": "A", - "trigger_file_path": "", - "already_installed_file_path": "", - "patches_file_path": "", - "non_invasive_recommendations_file_path": "", - "exclusions": ["floor_insulation", "fireplace"], - "budget": None, - "scenario_name": "Deep Retrofit", - "multi_plan": True, - }, - # Scenario B, floor insulation, PV, AHSP - { - "portfolio_id": str(87), - "housing_type": "Private", - "goal": "Increasing EPC", - "goal_value": "A", - "trigger_file_path": "", - "already_installed_file_path": "", - "patches_file_path": "", - "non_invasive_recommendations_file_path": "", - "exclusions": ["fireplace"], - "budget": None, - "scenario_name": "Whole House Retrofit", - "multi_plan": True, - } - ] - } } @@ -166,7 +130,7 @@ def main(): # For each property, we download the xmls and extract the data database_data = [] for uprn, xmls in assessments_map.items(): - + extracted_data = {} for xml in xmls: xml_data = read_from_s3(bucket_name=BUCKET, s3_file_name=xml)