mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-30 13:10:47 +00:00
added extraction of windows sap point
This commit is contained in:
parent
ebed7027ac
commit
89d49690b5
2 changed files with 16 additions and 8 deletions
|
|
@ -4,7 +4,7 @@ from dotenv import load_dotenv
|
||||||
from utils.s3 import save_csv_to_s3
|
from utils.s3 import save_csv_to_s3
|
||||||
from etl.find_my_epc.AssetListEpcData import AssetListEpcData
|
from etl.find_my_epc.AssetListEpcData import AssetListEpcData
|
||||||
|
|
||||||
PORTFOLIO_ID = 128
|
PORTFOLIO_ID = 129
|
||||||
USER_ID = 8
|
USER_ID = 8
|
||||||
|
|
||||||
load_dotenv(dotenv_path="backend/.env")
|
load_dotenv(dotenv_path="backend/.env")
|
||||||
|
|
@ -19,9 +19,9 @@ def app():
|
||||||
|
|
||||||
asset_list = [
|
asset_list = [
|
||||||
{
|
{
|
||||||
"address": "46",
|
"address": "19",
|
||||||
"postcode": "BS6 7BD",
|
"postcode": "IP21 4YJ",
|
||||||
"uprn": 61091,
|
"uprn": 2630134524,
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
asset_list = pd.DataFrame(asset_list)
|
asset_list = pd.DataFrame(asset_list)
|
||||||
|
|
@ -52,8 +52,8 @@ def app():
|
||||||
|
|
||||||
valuation_data = [
|
valuation_data = [
|
||||||
{
|
{
|
||||||
"uprn": 61091,
|
"uprn": 2630134524,
|
||||||
"valuation": 897_000
|
"valuation": 96_000
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
# Store valuation data to s3
|
# Store valuation data to s3
|
||||||
|
|
|
||||||
|
|
@ -215,21 +215,29 @@ class WindowsRecommendations:
|
||||||
"glazed-type": glazed_type_ending,
|
"glazed-type": glazed_type_ending,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
measure_type = "double_glazing" if not is_secondary_glazing else "secondary_glazing"
|
||||||
|
|
||||||
|
non_invasive_recommendation = next(
|
||||||
|
(r for r in self.property.non_invasive_recommendations if r["type"] in ["windows_glazing", measure_type]),
|
||||||
|
{}
|
||||||
|
)
|
||||||
|
|
||||||
self.recommendation = [
|
self.recommendation = [
|
||||||
{
|
{
|
||||||
"phase": phase,
|
"phase": phase,
|
||||||
"parts": [],
|
"parts": [],
|
||||||
"type": "windows_glazing",
|
"type": "windows_glazing",
|
||||||
"measure_type": "double_glazing" if not is_secondary_glazing else "secondary_glazing",
|
"measure_type": measure_type,
|
||||||
"description": description,
|
"description": description,
|
||||||
"starting_u_value": None,
|
"starting_u_value": None,
|
||||||
"new_u_value": None,
|
"new_u_value": None,
|
||||||
"sap_points": None,
|
"sap_points": non_invasive_recommendation.get("sap_points", None),
|
||||||
"already_installed": already_installed,
|
"already_installed": already_installed,
|
||||||
**cost_result,
|
**cost_result,
|
||||||
"is_secondary_glazing": is_secondary_glazing,
|
"is_secondary_glazing": is_secondary_glazing,
|
||||||
"description_simulation": description_simulation,
|
"description_simulation": description_simulation,
|
||||||
"simulation_config": simulation_config,
|
"simulation_config": simulation_config,
|
||||||
|
"survey": non_invasive_recommendation.get("survey", None),
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue