mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-08 11:17:27 +00:00
Merge pull request #678 from Hestia-Homes/portfolio-diagnostics
removing bug which is double removing installed SAP
This commit is contained in:
commit
941be42b83
2 changed files with 3 additions and 4 deletions
|
|
@ -1118,7 +1118,7 @@ async def model_engine(body: PlanTriggerRequest):
|
|||
p=p,
|
||||
input_measures=input_measures,
|
||||
budget=body.budget,
|
||||
target_gain=gain - already_installed_sap,
|
||||
target_gain=gain,
|
||||
enforce_heat_pump_insulation=True,
|
||||
enforce_fabric_first=body.enforce_fabric_first,
|
||||
already_installed_sap=already_installed_sap, # To be passed to output
|
||||
|
|
|
|||
|
|
@ -11,14 +11,13 @@ from etl.customers.cambridge.surveys import current_epc
|
|||
with db_session() as session:
|
||||
# We need installed measures, where the measure type is ewi or iwi
|
||||
installed_measures = session.query(InstalledMeasure).filter(
|
||||
InstalledMeasure.measure_type.in_(["external_wall_insulation", "internal_wall_insulation"])
|
||||
InstalledMeasure.measure_type.in_(["cavity_wall_insulation"])
|
||||
).all()
|
||||
# Get the uprns
|
||||
installed_uprns = [x.uprn for x in installed_measures]
|
||||
|
||||
installed_uprns = list(set(installed_uprns))
|
||||
|
||||
# This is 21425 properties.
|
||||
# We then create a portfolio of properties we need to re-run
|
||||
import pandas as pd
|
||||
|
||||
|
|
@ -33,7 +32,7 @@ needing_retry = sal[sal["epc_os_uprn"].isin(installed_uprns)]
|
|||
# Store
|
||||
needing_retry.to_excel(
|
||||
"/Users/khalimconn-kowlessar/Documents/hestia/Customers/Peabody/Nov 2025 Consulting Project/Final "
|
||||
"SAL/properties_needing_retry_20260115.xlsx",
|
||||
"SAL/properties_needing_retry_20260115 - cavity wall insulation.xlsx",
|
||||
sheet_name="Standardised Asset List",
|
||||
index=False
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue