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