mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-08 11:17:27 +00:00
Merge pull request #326 from Hestia-Homes/survey-extraction
Survey extraction
This commit is contained in:
commit
1d642e71e3
5 changed files with 23 additions and 0 deletions
3
etl/xml_survey_extraction/README.md
Normal file
3
etl/xml_survey_extraction/README.md
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
# Survey Extraction App
|
||||
|
||||
This app is responsible survey data from energy assessment XMLs
|
||||
9
etl/xml_survey_extraction/app.py
Normal file
9
etl/xml_survey_extraction/app.py
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
def main():
|
||||
"""
|
||||
This function executes the main process, which will retrieve data from the specified locations, extract the data
|
||||
fields and store them to our database
|
||||
:return:
|
||||
"""
|
||||
|
||||
# TODO: Build solution to get this data from Onedrive and store what we need in S3
|
||||
# In s3, we have a bucket called retrofit-energy-assessments-{stage} which
|
||||
|
|
@ -175,6 +175,12 @@ module "retrofit_hotwater_kwh_predictions" {
|
|||
allowed_origins = var.allowed_origins
|
||||
}
|
||||
|
||||
module "retrofit_energy_assessments" {
|
||||
source = "./modules/s3"
|
||||
bucketname = "retrofit-energy-assessments-${var.stage}"
|
||||
allowed_origins = var.allowed_origins
|
||||
}
|
||||
|
||||
# Set up the route53 record for the API
|
||||
module "route53" {
|
||||
source = "./modules/route53"
|
||||
|
|
|
|||
|
|
@ -782,6 +782,11 @@ class Recommendations:
|
|||
}
|
||||
}
|
||||
|
||||
# Prevent from being negative
|
||||
predicted_sap_points = 0 if predicted_sap_points < 0 else predicted_sap_points
|
||||
predicted_co2_savings = 0 if predicted_co2_savings < 0 else predicted_co2_savings
|
||||
predicted_heat_demand = 0 if predicted_heat_demand < 0 else predicted_heat_demand
|
||||
|
||||
if rec["type"] == "low_energy_lighting":
|
||||
# For the moment, we cap the number of SAP points that can be achieved by ventilation at 2
|
||||
rec["sap_points"] = min(predicted_sap_points, LightingRecommendations.SAP_LIMIT)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue