mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-30 13:10:47 +00:00
remove missing costs
This commit is contained in:
parent
fe80fa3036
commit
d032263857
2 changed files with 28 additions and 17 deletions
|
|
@ -728,8 +728,8 @@ class Property:
|
||||||
}
|
}
|
||||||
|
|
||||||
unadjusted_heating_costs = {
|
unadjusted_heating_costs = {
|
||||||
"heating": float(todays_heating_cost),
|
"heating": None,
|
||||||
"hot_water": float(todays_hot_water_cost),
|
"hot_water": None,
|
||||||
"lighting": float(todays_lighting_cost),
|
"lighting": float(todays_lighting_cost),
|
||||||
"appliances": float(appliances_kwh) * AnnualBillSavings.ELECTRICITY_PRICE_CAP
|
"appliances": float(appliances_kwh) * AnnualBillSavings.ELECTRICITY_PRICE_CAP
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -286,6 +286,31 @@ def create_epc_records(epc_searcher: SearchEpc, energy_assessment: dict):
|
||||||
}, energy_assessment_is_newer
|
}, energy_assessment_is_newer
|
||||||
|
|
||||||
|
|
||||||
|
def get_on_site_data(body: PlanTriggerRequest):
|
||||||
|
"""
|
||||||
|
This function will read in the on-site data from the S3 bucket
|
||||||
|
:param body: The request body
|
||||||
|
:return:
|
||||||
|
"""
|
||||||
|
patches = []
|
||||||
|
if body.patches_file_path:
|
||||||
|
patches = read_csv_from_s3(bucket_name=get_settings().PLAN_TRIGGER_BUCKET, filepath=body.patches_file_path)
|
||||||
|
|
||||||
|
already_installed = []
|
||||||
|
if body.already_installed_file_path:
|
||||||
|
already_installed = read_csv_from_s3(
|
||||||
|
bucket_name=get_settings().PLAN_TRIGGER_BUCKET, filepath=body.already_installed_file_path
|
||||||
|
)
|
||||||
|
|
||||||
|
non_invasive_recommendations = []
|
||||||
|
if body.non_invasive_recommendations_file_path:
|
||||||
|
non_invasive_recommendations = read_csv_from_s3(
|
||||||
|
bucket_name=get_settings().PLAN_TRIGGER_BUCKET, filepath=body.non_invasive_recommendations_file_path
|
||||||
|
)
|
||||||
|
|
||||||
|
return patches, already_installed, non_invasive_recommendations
|
||||||
|
|
||||||
|
|
||||||
router = APIRouter(
|
router = APIRouter(
|
||||||
prefix="/plan",
|
prefix="/plan",
|
||||||
tags=["plan"],
|
tags=["plan"],
|
||||||
|
|
@ -307,21 +332,7 @@ async def trigger_plan(body: PlanTriggerRequest):
|
||||||
logger.info("Getting the inputs")
|
logger.info("Getting the inputs")
|
||||||
plan_input = read_csv_from_s3(bucket_name=get_settings().PLAN_TRIGGER_BUCKET, filepath=body.trigger_file_path)
|
plan_input = read_csv_from_s3(bucket_name=get_settings().PLAN_TRIGGER_BUCKET, filepath=body.trigger_file_path)
|
||||||
# If we have patches or overrides, we should read them in here
|
# If we have patches or overrides, we should read them in here
|
||||||
patches = []
|
patches, already_installed, non_invasive_recommendations = get_on_site_data(body)
|
||||||
if body.patches_file_path:
|
|
||||||
patches = read_csv_from_s3(bucket_name=get_settings().PLAN_TRIGGER_BUCKET, filepath=body.patches_file_path)
|
|
||||||
|
|
||||||
already_installed = []
|
|
||||||
if body.already_installed_file_path:
|
|
||||||
already_installed = read_csv_from_s3(
|
|
||||||
bucket_name=get_settings().PLAN_TRIGGER_BUCKET, filepath=body.already_installed_file_path
|
|
||||||
)
|
|
||||||
|
|
||||||
non_invasive_recommendations = []
|
|
||||||
if body.non_invasive_recommendations_file_path:
|
|
||||||
non_invasive_recommendations = read_csv_from_s3(
|
|
||||||
bucket_name=get_settings().PLAN_TRIGGER_BUCKET, filepath=body.non_invasive_recommendations_file_path
|
|
||||||
)
|
|
||||||
|
|
||||||
cleaning_data = read_dataframe_from_s3_parquet(
|
cleaning_data = read_dataframe_from_s3_parquet(
|
||||||
bucket_name=get_settings().DATA_BUCKET, file_key="sap_change_model/cleaning_dataset.parquet",
|
bucket_name=get_settings().DATA_BUCKET, file_key="sap_change_model/cleaning_dataset.parquet",
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue