Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions data/input/equipment_data.JSON
Original file line number Diff line number Diff line change
Expand Up @@ -740,6 +740,7 @@
"awhp_redundancy": 1,
"awhp_h_supply_t": 38,
"awhp_use_cooling": false,
"awhp_sizing_priority": "heating",
"backup_heating": "bo03",
"chiller": "ch03"
},
Expand All @@ -756,6 +757,7 @@
"awhp_redundancy": 1,
"awhp_h_supply_t": 38,
"awhp_use_cooling": false,
"awhp_sizing_priority": "heating",
"backup_heating": "res02",
"chiller": "ch03"
},
Expand All @@ -772,6 +774,7 @@
"awhp_redundancy": 1,
"awhp_h_supply_t": 38,
"awhp_use_cooling": true,
"awhp_sizing_priority": "heating",
"backup_heating": "bo03",
"chiller": "ch03"
},
Expand All @@ -788,6 +791,7 @@
"awhp_redundancy": 1,
"awhp_h_supply_t": 38,
"awhp_use_cooling": true,
"awhp_sizing_priority": "heating",
"backup_heating": "res02",
"chiller": "ch03"
},
Expand All @@ -804,6 +808,7 @@
"awhp_redundancy": 1,
"awhp_h_supply_t": 38,
"awhp_use_cooling": true,
"awhp_sizing_priority": "heating",
"backup_heating": "res02",
"chiller": "ch03"
},
Expand All @@ -820,6 +825,7 @@
"awhp_redundancy": 1,
"awhp_h_supply_t": 38,
"awhp_use_cooling": true,
"awhp_sizing_priority": "heating",
"backup_heating": "bo03",
"chiller": "ch03"
},
Expand All @@ -836,6 +842,7 @@
"awhp_redundancy": 1,
"awhp_h_supply_t": 38,
"awhp_use_cooling": true,
"awhp_sizing_priority": "heating",
"backup_heating": "bo03",
"chiller": "ch03"
},
Expand All @@ -852,6 +859,7 @@
"awhp_redundancy": 1,
"awhp_h_supply_t": 38,
"awhp_use_cooling": true,
"awhp_sizing_priority": "heating",
"backup_heating": "bo03",
"chiller": "ch03"
},
Expand All @@ -868,6 +876,7 @@
"awhp_redundancy": 1,
"awhp_h_supply_t": 38,
"awhp_use_cooling": true,
"awhp_sizing_priority": "heating",
"backup_heating": "bo03",
"chiller": "ch03"
},
Expand All @@ -884,6 +893,7 @@
"awhp_redundancy": 1,
"awhp_h_supply_t": 38,
"awhp_use_cooling": false,
"awhp_sizing_priority": "heating",
"backup_heating": "bo03",
"chiller": "ch03"
},
Expand All @@ -900,6 +910,7 @@
"awhp_redundancy": 1,
"awhp_h_supply_t": 38,
"awhp_use_cooling": false,
"awhp_sizing_priority": "heating",
"backup_heating": "res02",
"chiller": "ch03"
},
Expand All @@ -916,6 +927,7 @@
"awhp_redundancy": 1,
"awhp_h_supply_t": 38,
"awhp_use_cooling": true,
"awhp_sizing_priority": "heating",
"backup_heating": "res02",
"chiller": "ch03"
},
Expand All @@ -932,6 +944,7 @@
"awhp_redundancy": 1,
"awhp_h_supply_t": 52,
"awhp_use_cooling": true,
"awhp_sizing_priority": "heating",
"backup_heating": "res02",
"chiller": "ch03"
},
Expand All @@ -948,6 +961,7 @@
"awhp_redundancy": 1,
"awhp_h_supply_t": 38,
"awhp_use_cooling": true,
"awhp_sizing_priority": "heating",
"backup_heating": "res02",
"chiller": "ch03"
},
Expand All @@ -964,6 +978,7 @@
"awhp_redundancy": 1,
"awhp_h_supply_t": 52,
"awhp_use_cooling": true,
"awhp_sizing_priority": "heating",
"backup_heating": "res02",
"chiller": "ch03"
}
Expand Down
37 changes: 32 additions & 5 deletions layout/input.py
Original file line number Diff line number Diff line change
Expand Up @@ -526,6 +526,7 @@ def build_equipment_table(
("awhp_sizing_value", "AWHP Sizing Value"),
("awhp_redundancy", "AWHP Redundancy"),
("awhp_use_cooling", "AWHP Use Cooling"),
("awhp_sizing_priority", "AWHP Sizing Priority"),
("backup_heating", "Backup Heating"),
("chiller", "Backup Cooling"),
]
Expand Down Expand Up @@ -976,12 +977,38 @@ def edit_equipment_modal():
],
grow=True,
),
dmc.Switch(
id="edit-awhp-use-cooling",
label="Use heat pump also for cooling",
mt="xs",
dmc.Group(
[
dmc.Switch(
id="edit-awhp-use-cooling",
label="Use heat pump also for cooling",
mt="xs",
),
dmc.Select(
id="edit-awhp-sizing-priority",
label="Sizing priority",
placeholder="None",
data=[
{
"label": "Heating load",
"value": "heating",
},
{
"label": "Cooling load",
"value": "cooling",
},
{
"label": "Larger of heating and cooling load",
"value": "larger",
},
],
clearable=True,
searchable=True,
),
],
grow = True,
),
]
],
),
dmc.Divider(label="Backup equipment", labelPosition="center"),
dmc.SimpleGrid(
Expand Down
1 change: 1 addition & 0 deletions layout/output.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ def get_value(self, path: str):
("awhp_sizing_value", "AWHP Sizing Value"),
("awhp_redundancy", "AWHP Redundancy"),
("awhp_use_cooling", "AWHP Use Cooling"),
("awhp_sizing_priority", "AWHP Sizing Priority"),
("backup_heating", "Backup Heating"),
("chiller", "Chiller"),
]
Expand Down
29 changes: 26 additions & 3 deletions pages/equipment_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -681,6 +681,7 @@ def reset_equipment(n_clicks, initial_data):
Output("edit-awhp-sizing-value", "value"),
Output("edit-awhp-redundancy", "value"),
Output("edit-awhp-use-cooling", "checked"),
Output("edit-awhp-sizing-priority", "value"),
Output("edit-backup-heating-select", "data"),
Output("edit-backup-heating-select", "value"),
Output("edit-chiller-select", "data"),
Expand All @@ -697,7 +698,7 @@ def open_edit_modal(edit_clicks, equipment_data, unit_mode):
pre-filling all editable fields.
"""
if not any(edit_clicks or []):
return (no_update,) * 20
return (no_update,) * 21

if not equipment_data:
return (
Expand All @@ -716,6 +717,7 @@ def open_edit_modal(edit_clicks, equipment_data, unit_mode):
None,
None,
False,
None,
[],
None,
[],
Expand All @@ -728,7 +730,7 @@ def open_edit_modal(edit_clicks, equipment_data, unit_mode):

triggered = callback_context.triggered
if not triggered:
return (no_update,) * 20
return (no_update,) * 21

prop_id = triggered[0]["prop_id"]
id_str = prop_id.split(".")[0]
Expand All @@ -752,6 +754,7 @@ def open_edit_modal(edit_clicks, equipment_data, unit_mode):
None,
None,
False,
None,
[],
None,
[],
Expand Down Expand Up @@ -781,6 +784,7 @@ def open_edit_modal(edit_clicks, equipment_data, unit_mode):
None,
None,
False,
None,
[],
None,
[],
Expand Down Expand Up @@ -844,6 +848,7 @@ def open_edit_modal(edit_clicks, equipment_data, unit_mode):
sizing_value = scenario.get("awhp_sizing_value", 1.0)
redundancy = scenario.get("awhp_redundancy", 1)
use_cooling = scenario.get("awhp_use_cooling", False)
sizing_priority = scenario.get("awhp_sizing_priority") or "heating"

backup_heating_val = scenario.get("backup_heating")
chiller_val = scenario.get("chiller")
Expand All @@ -864,6 +869,7 @@ def open_edit_modal(edit_clicks, equipment_data, unit_mode):
sizing_value,
redundancy,
use_cooling,
sizing_priority,
backup_heating_options,
backup_heating_val,
chiller_options,
Expand All @@ -889,6 +895,7 @@ def open_edit_modal(edit_clicks, equipment_data, unit_mode):
State("edit-awhp-sizing-value", "value"),
State("edit-awhp-redundancy", "value"),
State("edit-awhp-use-cooling", "checked"),
State("edit-awhp-sizing-priority", "value"),
State("edit-backup-heating-select", "value"),
State("edit-chiller-select", "value"),
State("equipment-store", "data"),
Expand All @@ -909,6 +916,7 @@ def save_edit_scenario(
sizing_value,
redundancy,
use_cooling,
sizing_priority,
backup_heating_val,
chiller_val,
equipment_data,
Expand Down Expand Up @@ -980,6 +988,7 @@ def save_edit_scenario(
new_scen["awhp_sizing_value"] = sizing_value
new_scen["awhp_redundancy"] = redundancy
new_scen["awhp_use_cooling"] = use_cooling
new_scen["awhp_sizing_priority"] = sizing_priority
new_scen["backup_heating"] = backup_heating_val
new_scen["chiller"] = chiller_val
new_scenarios.append(new_scen)
Expand Down Expand Up @@ -1153,8 +1162,22 @@ def update_perf_model_on_hp_change(hr_hp_id, awhp_id):
return (not hr_selected, not awhp_selected)


# helper to build equipment options for Selects
@callback(
Output("edit-awhp-sizing-priority", "disabled"),
Input("edit-awhp-use-cooling", "checked"),
Input("edit-awhp-sizing-mode", "value"),
prevent_initial_call=True,
)
def update_sizing_priority(use_cooling, sizing_mode):
"""Enable/disable AWHP sizing priority input when use-cooling or sizing mode changes."""

# Disable input if AWHP is not used for cooling or if sizing is not based on peak load
disabled = (use_cooling == False) or (sizing_mode == "fixed_num_units")

return disabled


# helper to build equipment options for Selects

def _build_equipment_options(
equipment_list, eq_type, unit_mode, include_none=False, none_label="None"
Expand Down
5 changes: 3 additions & 2 deletions src/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ class EquipmentTableRows(Enum):
"awhp_sizing_value",
"awhp_redundancy",
"awhp_use_cooling",
"awhp_sizing_priority",
"backup_heating",
"chiller",
)
Expand Down Expand Up @@ -99,8 +100,8 @@ class Columns(StrEnum):
ELEC_HR_WH = "elec_hr_Wh"

# --- Air-Water Heat Pump (Heating) ---
AWHP_NUM_H = "awhp_num_h"
AWHP_NUM_H_R = "awhp_num_h_redundant"
AWHP_NUM = "awhp_num"
AWHP_NUM_R = "awhp_num_redundant"
AWHP_CAP_H_W = "awhp_cap_h_W"
AWHP_COP_H = "awhp_cop_h"
AWHP_HHW_W = "awhp_hhw_W"
Expand Down
Loading