Skip to content
Merged
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
25 changes: 25 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,31 @@ Removed. `scripts/bump_version.py` turns them into a release section.

## [Unreleased]

### Added

- Reset button in the Scale Load Profile and Modify Base Load modals to restore the load
without scaling or base load
- Confirm button in both modals: Apply only updates the values shown in the modal, so several
changes (e.g. heating and cooling) can be made before Confirm uses them in the calculation
- Modify Base Load modal shows peak loads without and with the base load side by side
- Status line in both modals says what is in the table and whether Apply or Confirm is needed
next; Confirm is disabled while an entered value has not been applied or nothing changed

### Changed

- Scale Load Profile modal shows the original library values next to the scaled values instead
of overwriting them
- Scaling by peak heating or peak cooling load only scales that load; heating and cooling
factors are kept separately, so both peaks can be matched
- Heating and cooling can each have their own base load (floor or offset); applying a base
load replaces the previous one for that load type instead of stacking, and base loads are
always applied after scaling

### Fixed

- Applying load scaling repeatedly no longer compounds the scale factor
- Input labels and the base load method description show as soon as the modals open

## [0.1.0] - 2026-10-13

First versioned release of the tool. Earlier deployments were not versioned consistently;
Expand Down
59 changes: 38 additions & 21 deletions layout/input.py
Original file line number Diff line number Diff line change
Expand Up @@ -1608,6 +1608,30 @@ def build_completeness_modal():
)


def _load_modification_buttons(prefix):
"""Reset (left) and Cancel / Apply / Confirm (right) for the scale and base load modals.

Apply only updates the modal's draft; Confirm commits it to the load data.
"""
return dmc.Group(
[
dmc.Button(
"Reset", id=f"{prefix}-reset-btn", variant="outline", color="red", disabled=True
),
dmc.Group(
[
dmc.Button("Cancel", id=f"{prefix}-cancel-btn", variant="outline"),
dmc.Button("Apply", id=f"{prefix}-apply-btn", variant="outline"),
dmc.Button("Confirm", id=f"{prefix}-confirm-btn", color="blue"),
],
gap="sm",
),
],
justify="space-between",
mt="md",
)


def build_scale_load_modal():
"""Modal for scaling/normalizing a library load profile."""
return dmc.Modal(
Expand All @@ -1619,7 +1643,9 @@ def build_scale_load_modal():
children=[
dmc.Text(
"Scale the library load profile to match your building. "
"Every hourly heating and cooling load will be multiplied by the computed scale factor.",
"Scaling by building area multiplies every hourly heating and cooling load by the "
"computed scale factor; scaling by peak heating or peak cooling load only changes "
"that load. Apply updates the table; Confirm uses the result in the calculation.",
size="sm",
c="dimmed",
),
Expand Down Expand Up @@ -1649,16 +1675,10 @@ def build_scale_load_modal():
mt=4,
),
dmc.Space(h="sm"),
dmc.Text(id="scale-preview-text", c="blue", size="sm", fw=500),
dmc.Text(id="scale-error-text", c="red", size="sm"),
dmc.Group(
[
dmc.Button("Cancel", id="scale-cancel-btn", variant="outline"),
dmc.Button("Apply", id="scale-apply-btn", color="blue"),
],
justify="flex-end",
mt="md",
),
# Status line: always filled so the layout doesn't jump; colour set by callback
dmc.Text("No scaling applied", id="scale-preview-text", c="dimmed", size="sm", fw=500),
_load_modification_buttons("scale"),
dcc.Store(id="scale-draft-store", data=None),
],
)

Expand All @@ -1674,7 +1694,8 @@ def build_base_load_modal():
children=[
dmc.Text(
"Add a minimum floor or a constant offset to model process loads or "
"minimum baseline consumption.",
"minimum baseline consumption. Heating and cooling can each have their own "
"base load. Apply updates the table; Confirm uses the result in the calculation.",
size="sm",
c="dimmed",
),
Expand Down Expand Up @@ -1719,16 +1740,12 @@ def build_base_load_modal():
mt=4,
),
dmc.Space(h="sm"),
dmc.Text(id="base-load-preview-text", c="blue", size="sm", fw=500),
dmc.Text(id="base-load-error-text", c="red", size="sm"),
dmc.Group(
[
dmc.Button("Cancel", id="base-load-cancel-btn", variant="outline"),
dmc.Button("Apply", id="base-load-apply-btn", color="blue"),
],
justify="flex-end",
mt="md",
# Status line: always filled so the layout doesn't jump; colour set by callback
dmc.Text(
"No base load applied", id="base-load-preview-text", c="dimmed", size="sm", fw=500
),
_load_modification_buttons("base-load"),
dcc.Store(id="base-load-draft-store", data=None),
],
)

Expand Down
Loading
Loading