mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-08 11:17:27 +00:00
made mains gas flag boolean
This commit is contained in:
parent
69af82a5db
commit
ed37059581
3 changed files with 5 additions and 5 deletions
|
|
@ -134,7 +134,7 @@ def extract_portfolio_aggregation_data(
|
|||
lower_bound_valuation_uplift, upper_bound_valuation_uplift = 0, 0
|
||||
|
||||
agg_data.append({
|
||||
"pre_retrofit_epc": p.data["current-energy-rating"],
|
||||
"pre_retrofit_epc": p.epc_record.current_energy_rating,
|
||||
"post_retrofit_epc": new_epc_bands[p.id],
|
||||
"pre_retrofit_co2": pre_retrofit_co2,
|
||||
"post_retrofit_co2": post_retrofit_co2,
|
||||
|
|
@ -1145,7 +1145,7 @@ async def model_engine(body: PlanTriggerRequest):
|
|||
optimiser.solve()
|
||||
solution = optimiser.solution
|
||||
gain = optimiser.solution_gain
|
||||
post_sap = int(p.data["current-energy-efficiency"]) + gain
|
||||
post_sap = p.epc_record.current_energy_efficiency + gain
|
||||
|
||||
pv_size = next(
|
||||
(m["array_size"] for m in solution if m["type"] == "solar_pv"), 0
|
||||
|
|
@ -1242,7 +1242,7 @@ async def model_engine(body: PlanTriggerRequest):
|
|||
|
||||
# This will include everything, including already installed
|
||||
total_sap_points = sum([r["sap_points"] for r in default_recommendations])
|
||||
new_sap_points = float(p.data["current-energy-efficiency"]) + total_sap_points
|
||||
new_sap_points = p.epc_record.current_energy_efficiency + total_sap_points
|
||||
new_epc = sap_to_epc(new_sap_points)
|
||||
# Already installed measures do not have a cost but we remove anyway
|
||||
total_cost = sum([r["total"] for r in default_recommendations if not r["already_installed"]])
|
||||
|
|
|
|||
|
|
@ -216,7 +216,7 @@ class PropertyValuation:
|
|||
cls.UPRN_VALUE_LOOKUP.get(property_instance.uprn)
|
||||
)
|
||||
|
||||
current_epc = property_instance.data["current-energy-rating"]
|
||||
current_epc = property_instance.epc_record.current_energy_rating
|
||||
|
||||
if not current_value:
|
||||
# In this case, we return a % improvement rather than an absolute
|
||||
|
|
|
|||
|
|
@ -186,7 +186,7 @@ class EPCRecord:
|
|||
heat_loss_corridor: Optional[str] = None
|
||||
unheated_corridor_length: Optional[float] = None
|
||||
|
||||
mains_gas_flag: Optional[str] = None
|
||||
mains_gas_flag: Optional[bool] = None
|
||||
|
||||
# ------------------------------------------------------------------
|
||||
# BUILDING FABRIC DESCRIPTIONS
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue