mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-08 11:17:27 +00:00
increase timeout of engine dispatcher
This commit is contained in:
parent
dbf75bf559
commit
0876e948c9
2 changed files with 95 additions and 94 deletions
|
|
@ -74,125 +74,125 @@ sustainability_data["Floor Area Band"] = sustainability_data["Total Floor Area (
|
|||
# Roof insulation category
|
||||
# 1) Split roof insulation into > 100mm loft and <= 100mm loft
|
||||
sustainability_data["Roof Insulation Category"] = sustainability_data["Roof Insulation"].copy()
|
||||
sustainability_data["Roof Insulation Category"] = np.where(
|
||||
sustainability_data["Roof Insulation Category"].isin(
|
||||
['mm200', 'mm300', 'mm250', 'mm150', 'mm270', 'mm400', 'mm350'],
|
||||
),
|
||||
"LI > 100mm",
|
||||
sustainability_data["Roof Insulation Category"],
|
||||
)
|
||||
# sustainability_data["Roof Insulation Category"] = np.where(
|
||||
# sustainability_data["Roof Insulation Category"].isin(
|
||||
# ['mm200', 'mm300', 'mm250', 'mm150', 'mm270', 'mm400', 'mm350'],
|
||||
# ),
|
||||
# "LI > 100mm",
|
||||
# sustainability_data["Roof Insulation Category"],
|
||||
# )
|
||||
|
||||
sustainability_data["Roof Insulation Category"] = np.where(
|
||||
sustainability_data["Roof Insulation Category"].isin(
|
||||
['mm100', 'mm50', 'mm75', 'mm25'],
|
||||
),
|
||||
"LI <= 100mm",
|
||||
sustainability_data["Roof Insulation Category"],
|
||||
)
|
||||
# sustainability_data["Roof Insulation Category"] = np.where(
|
||||
# sustainability_data["Roof Insulation Category"].isin(
|
||||
# ['mm100', 'mm50', 'mm75', 'mm25'],
|
||||
# ),
|
||||
# "LI <= 100mm",
|
||||
# sustainability_data["Roof Insulation Category"],
|
||||
# )
|
||||
|
||||
# 2) Group all of the glazed together (e.g. double glazed, secondary glazed, triple glazed)
|
||||
sustainability_data["Glazing Type"] = sustainability_data["Glazing"].copy()
|
||||
sustainability_data["Glazing Type"] = np.where(
|
||||
sustainability_data["Glazing Type"].isin(
|
||||
['Double 2002 or later', 'Double before 2002', 'Double but age unknown', 'DoubleKnownData']
|
||||
),
|
||||
"Double Glazed",
|
||||
sustainability_data["Glazing Type"],
|
||||
)
|
||||
sustainability_data["Glazing Type"] = np.where(
|
||||
sustainability_data["Glazing Type"].isin(['Triple', 'TripleKnownData']),
|
||||
"Triple Glazed",
|
||||
sustainability_data["Glazing Type"],
|
||||
)
|
||||
# sustainability_data["Glazing Type"] = np.where(
|
||||
# sustainability_data["Glazing Type"].isin(
|
||||
# ['Double 2002 or later', 'Double before 2002', 'Double but age unknown', 'DoubleKnownData']
|
||||
# ),
|
||||
# "Double Glazed",
|
||||
# sustainability_data["Glazing Type"],
|
||||
# )
|
||||
# sustainability_data["Glazing Type"] = np.where(
|
||||
# sustainability_data["Glazing Type"].isin(['Triple', 'TripleKnownData']),
|
||||
# "Triple Glazed",
|
||||
# sustainability_data["Glazing Type"],
|
||||
# )
|
||||
|
||||
# 3) Group up boiler efficiency A, B-D, E - G? or someting like this
|
||||
sustainability_data["Boiler Efficiency Group"] = sustainability_data["Boiler Efficiency"].copy()
|
||||
sustainability_data["Boiler Efficiency Group"] = np.where(
|
||||
sustainability_data["Boiler Efficiency Group"].isin(['B', 'C', 'D']),
|
||||
"B-D",
|
||||
sustainability_data["Boiler Efficiency Group"],
|
||||
)
|
||||
sustainability_data["Boiler Efficiency Group"] = np.where(
|
||||
sustainability_data["Boiler Efficiency Group"].isin(['E', 'F', 'G']),
|
||||
"E-G",
|
||||
sustainability_data["Boiler Efficiency Group"],
|
||||
)
|
||||
# sustainability_data["Boiler Efficiency Group"] = np.where(
|
||||
# sustainability_data["Boiler Efficiency Group"].isin(['B', 'C', 'D']),
|
||||
# "B-D",
|
||||
# sustainability_data["Boiler Efficiency Group"],
|
||||
# )
|
||||
# sustainability_data["Boiler Efficiency Group"] = np.where(
|
||||
# sustainability_data["Boiler Efficiency Group"].isin(['E', 'F', 'G']),
|
||||
# "E-G",
|
||||
# sustainability_data["Boiler Efficiency Group"],
|
||||
# )
|
||||
|
||||
# 4) Group up main fuel into gas, electric, oil, other?
|
||||
sustainability_data["Main Fuel Group"] = sustainability_data["Main Fuel"].copy()
|
||||
sustainability_data["Main Fuel Group"] = np.where(
|
||||
sustainability_data["Main Fuel Group"].isin(
|
||||
["SmokelessCoal", "BiomassCommunity", "B30DCommunity"]
|
||||
),
|
||||
"Other Fuel",
|
||||
sustainability_data["Main Fuel Group"],
|
||||
)
|
||||
# sustainability_data["Main Fuel Group"] = np.where(
|
||||
# sustainability_data["Main Fuel Group"].isin(
|
||||
# ["SmokelessCoal", "BiomassCommunity", "B30DCommunity"]
|
||||
# ),
|
||||
# "Other Fuel",
|
||||
# sustainability_data["Main Fuel Group"],
|
||||
# )
|
||||
|
||||
# 5) Wall Construction - group up Sandstone and Granite into one category
|
||||
sustainability_data["Wall Construction"] = np.where(
|
||||
sustainability_data["Wall Construction"].isin(["Sandstone", "Granite"]),
|
||||
"Sandstone/Granite",
|
||||
sustainability_data["Wall Construction"]
|
||||
)
|
||||
# sustainability_data["Wall Construction"] = np.where(
|
||||
# sustainability_data["Wall Construction"].isin(["Sandstone", "Granite"]),
|
||||
# "Sandstone/Granite",
|
||||
# sustainability_data["Wall Construction"]
|
||||
# )
|
||||
|
||||
sustainability_data["Wall Construction"] = np.where(
|
||||
sustainability_data["Wall Construction"].isin(["Timber Frame", "System", "Solid Brick"]),
|
||||
"Solid",
|
||||
sustainability_data["Wall Construction"]
|
||||
)
|
||||
# sustainability_data["Wall Construction"] = np.where(
|
||||
# sustainability_data["Wall Construction"].isin(["Timber Frame", "System"]),
|
||||
# "Timber/System",
|
||||
# sustainability_data["Wall Construction"]
|
||||
# )
|
||||
|
||||
# 6) Reduce or remove floor construction
|
||||
sustainability_data["Floor Construction"] = np.where(
|
||||
sustainability_data["Floor Construction"].isin(["SuspendedTimber", "SuspendedNotTimber"]),
|
||||
"Suspended Floor",
|
||||
sustainability_data["Floor Construction"]
|
||||
)
|
||||
# sustainability_data["Floor Construction"] = np.where(
|
||||
# sustainability_data["Floor Construction"].isin(["SuspendedTimber", "SuspendedNotTimber"]),
|
||||
# "Suspended Floor",
|
||||
# sustainability_data["Floor Construction"]
|
||||
# )
|
||||
|
||||
# 7) Reduce wall insulation
|
||||
sustainability_data["Wall Insulation"] = np.where(
|
||||
sustainability_data["Wall Insulation"].isin(
|
||||
["FilledCavityPlusInternal", "FilledCavityPlusExternal", "FilledCavity", "External", "Internal"]
|
||||
),
|
||||
"Insulated",
|
||||
sustainability_data["Wall Insulation"]
|
||||
)
|
||||
# sustainability_data["Wall Insulation"] = np.where(
|
||||
# sustainability_data["Wall Insulation"].isin(
|
||||
# ["FilledCavityPlusInternal", "FilledCavityPlusExternal", "FilledCavity", "External", "Internal"]
|
||||
# ),
|
||||
# "Insulated",
|
||||
# sustainability_data["Wall Insulation"]
|
||||
# )
|
||||
|
||||
# 8) Fill floor insulation
|
||||
sustainability_data["Floor Insulation"] = sustainability_data["Floor Insulation"].fillna("Unknown")
|
||||
|
||||
# 9) Reduce Age bands
|
||||
sustainability_data["Construction Years"] = np.where(
|
||||
sustainability_data["Construction Years"].isin(["2003-2006", "2007-2011", "2012 onwards"]),
|
||||
"2003 onwards",
|
||||
sustainability_data["Construction Years"],
|
||||
)
|
||||
# sustainability_data["Construction Years"] = np.where(
|
||||
# sustainability_data["Construction Years"].isin(["2003-2006", "2007-2011", "2012 onwards"]),
|
||||
# "2003 onwards",
|
||||
# sustainability_data["Construction Years"],
|
||||
# )
|
||||
|
||||
sustainability_data["Construction Years"] = np.where(
|
||||
sustainability_data["Construction Years"].isin(["Before 1900", "1900-1929"]),
|
||||
"Before 1929",
|
||||
sustainability_data["Construction Years"],
|
||||
)
|
||||
# sustainability_data["Construction Years"] = np.where(
|
||||
# sustainability_data["Construction Years"].isin(["Before 1900", "1900-1929"]),
|
||||
# "Before 1929",
|
||||
# sustainability_data["Construction Years"],
|
||||
# )
|
||||
|
||||
sustainability_data["Construction Years"] = np.where(
|
||||
sustainability_data["Construction Years"].isin(["1983-1990", "1991-1995"]),
|
||||
"1983-1995",
|
||||
sustainability_data["Construction Years"],
|
||||
)
|
||||
# sustainability_data["Construction Years"] = np.where(
|
||||
# sustainability_data["Construction Years"].isin(["1983-1990", "1991-1995"]),
|
||||
# "1983-1995",
|
||||
# sustainability_data["Construction Years"],
|
||||
# )
|
||||
|
||||
sustainability_data["Construction Years"] = np.where(
|
||||
sustainability_data["Construction Years"].isin(["1950-1966", "1967-1975", "1976-1982"]),
|
||||
"1950-1982",
|
||||
sustainability_data["Construction Years"],
|
||||
)
|
||||
# sustainability_data["Construction Years"] = np.where(
|
||||
# sustainability_data["Construction Years"].isin(["1950-1966", "1967-1975", "1976-1982"]),
|
||||
# "1950-1982",
|
||||
# sustainability_data["Construction Years"],
|
||||
# )
|
||||
|
||||
# Roof
|
||||
sustainability_data["Roof Construction"] = np.where(
|
||||
sustainability_data["Roof Construction"].isin(
|
||||
["PitchedNormalLoftAccess", "PitchedThatched", "PitchedNormalNoLoftAccess", "PitchedWithSlopingCeiling"]
|
||||
),
|
||||
"Pitched Roof",
|
||||
sustainability_data["Roof Construction"]
|
||||
)
|
||||
# sustainability_data["Roof Construction"] = np.where(
|
||||
# sustainability_data["Roof Construction"].isin(
|
||||
# ["PitchedNormalLoftAccess", "PitchedThatched", "PitchedNormalNoLoftAccess", "PitchedWithSlopingCeiling"]
|
||||
# ),
|
||||
# "Pitched Roof",
|
||||
# sustainability_data["Roof Construction"]
|
||||
# )
|
||||
|
||||
archetype_variables = [
|
||||
"Type", "Attachment", "Construction Years", "Wall Construction", "Wall Insulation",
|
||||
|
|
@ -210,7 +210,7 @@ archetypes = sustainability_data[archetype_variables + ["UPRN"]].dropna().groupb
|
|||
archetypes["Cumulative Count"] = archetypes["Count"].cumsum()
|
||||
archetypes["Cumulative Proportion"] = archetypes["Cumulative Count"] / archetypes["Count"].sum()
|
||||
|
||||
archetypes_95 = archetypes[archetypes["Cumulative Proportion"] <= 0.97]
|
||||
archetypes_95 = archetypes.copy()
|
||||
archetypes_95["Archetypes_95_reference"] = archetypes_95.index + 1
|
||||
archetypes_95["Archetypes_95_reference"] = "Archetype_Sample_" + archetypes_95["Archetypes_95_reference"].astype(str)
|
||||
|
||||
|
|
@ -290,6 +290,7 @@ modelling_sample["domna_full_address"] = modelling_sample.apply(lambda x: make_f
|
|||
# Save this CSV as input
|
||||
modelling_sample.to_excel(
|
||||
"/Users/khalimconn-kowlessar/Documents/hestia/Customers/Peabody/Nov 2025 Consulting Project/modelling_sample.xlsx",
|
||||
sheet_name="Standardised Asset List"
|
||||
)
|
||||
# Save the archetype definitions
|
||||
archetypes_95.to_excel(
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ functions:
|
|||
|
||||
fastapi-backend:
|
||||
handler: backend.app.main.handler
|
||||
timeout: 60
|
||||
timeout: 600
|
||||
memorySize: 512
|
||||
role: FastApiLambdaRole
|
||||
events:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue