Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
ad64851
Perfect! Here's the **final complete renaming table with Option A**:
FBumann Nov 18, 2025
4023668
Refactor tests and examples
FBumann Nov 18, 2025
ff0eaf6
Refactor tests and examples
FBumann Nov 18, 2025
07bddd4
Update CHANGELOG.md
FBumann Nov 18, 2025
7452711
Python Docstrings Updated:
FBumann Nov 18, 2025
c1b9ed6
Update remaining mentions of old parameters
FBumann Nov 18, 2025
0fbd26a
⏺ Perfect! I've addressed all the actionable review comments:
FBumann Nov 18, 2025
51d0b8e
Changes Made:
FBumann Nov 18, 2025
1b83d24
Fixed Issues
FBumann Nov 18, 2025
538f691
Delete mistakingly added files
FBumann Nov 18, 2025
ee56d28
Delete mistakingly added files
FBumann Nov 18, 2025
9aed635
Final touches
FBumann Nov 18, 2025
4df3ae4
Final touches
FBumann Nov 18, 2025
0149b34
Replace off with inactive
FBumann Nov 18, 2025
9fe2755
Rename low level parameetrs as well:
FBumann Nov 18, 2025
27e19b7
Rename low level parameetrs as well:
FBumann Nov 18, 2025
c583af8
Rename low level parameetrs as well:
FBumann Nov 18, 2025
d412f3e
Docstring Improvements Summary
FBumann Nov 18, 2025
220e738
Update docs
FBumann Nov 18, 2025
9619865
Add missing type hints
FBumann Nov 18, 2025
e220ebc
Fix bullet points
FBumann Nov 18, 2025
6aeb0d3
Fix bullet points
FBumann Nov 18, 2025
386b86f
Merge branch 'main' into feature/rename-on-off-2
FBumann Nov 19, 2025
81685cc
Re-apply changes from main
FBumann Nov 19, 2025
38068e6
Bugfix: Usage of old on_off_parameters
FBumann Nov 19, 2025
f69f626
Update CHANGELOG.md
FBumann Nov 19, 2025
641795c
Update CHANGELOG.md
FBumann Nov 19, 2025
509e9f6
Merge branch 'feature/v5' into feature/rename-on-off-2
FBumann Nov 19, 2025
01b09de
Update CHANGELOG.md
FBumann Nov 19, 2025
dad2b02
Fix typos
FBumann Nov 19, 2025
83216da
Improve flagging of wether to create inactive varaible
FBumann Nov 19, 2025
4d72918
Improve default upper bound of active_hours
FBumann Nov 19, 2025
8804067
Merge branch 'feature/v5' into feature/rename-on-off-2
FBumann Nov 30, 2025
0f95652
Bugfix self._model.hours_per_step.sum('time').item() with scenarios/p…
FBumann Nov 30, 2025
2d58043
Fix test
FBumann Nov 30, 2025
d0d42c8
FIx names
FBumann Nov 30, 2025
0ae4703
pdate the test assertions to expect upper=total_hours instead of uppe…
FBumann Nov 30, 2025
b692ef4
Empty
FBumann Nov 30, 2025
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
2 changes: 1 addition & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
pull_request:
branches: ["*"]
workflow_dispatch:
workflow_call: # Allow release.yaml to call this workflow
workflow_call: # Allow release.yaml to call this workflow.

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand Down
68 changes: 65 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,76 @@ If upgrading from v2.x, see the [v3.0.0 release notes](https://github.com/flixOp

## [Unreleased] - ????-??-??

**Summary**:

If upgrading from v2.x, see the [v3.0.0 release notes](https://github.com/flixOpt/flixOpt/releases/tag/v3.0.0) and [Migration Guide](https://flixopt.github.io/flixopt/latest/user-guide/migration-guide-v3/).
**Summary**: Renamed OnOff terminology to Status terminology for better alignment with PyPSA and unit commitment standards.

### ✨ Added

### 💥 Breaking Changes

**Renamed `OnOffParameters` → `StatusParameters`**: Complete terminology update to align with industry standards (PyPSA, unit commitment). This is a clean breaking change with no backwards compatibility wrapper.

**Class and Constructor Parameters:**

| Category | Old Name (OnOffParameters) | New Name (StatusParameters) | Notes |
|----------|---------------------------|----------------------------|-------|
| **Class** | `OnOffParameters` | `StatusParameters` | Main class renamed |
| **Constructor** | `on_variable` | `status` | Model variable parameter |
| **Constructor** | `previous_states` | `previous_status` | Initial state parameter |
| **Parameter** | `effects_per_switch_on` | `effects_per_startup` | Startup costs/impacts |
| **Parameter** | `effects_per_running_hour` | `effects_per_active_hour` | Operating costs/impacts |
| **Parameter** | `on_hours_total_min` | `active_hours_min` | Minimum total operating hours |
| **Parameter** | `on_hours_total_max` | `active_hours_max` | Maximum total operating hours |
| **Parameter** | `consecutive_on_hours_min` | `min_uptime` | UC standard terminology |
| **Parameter** | `consecutive_on_hours_max` | `max_uptime` | UC standard terminology |
| **Parameter** | `consecutive_off_hours_min` | `min_downtime` | UC standard terminology |
| **Parameter** | `consecutive_off_hours_max` | `max_downtime` | UC standard terminology |
| **Parameter** | `switch_on_total_max` | `startup_limit` | Maximum number of startups |
| **Parameter** | `force_switch_on` | `force_startup_tracking` | Force creation of startup variables |

**Model Classes and Variables:**

| Category | Old Name (OnOffModel) | New Name (StatusModel) | Notes |
|----------|----------------------|------------------------|-------|
| **Model Class** | `OnOffModel` | `StatusModel` | Feature model class |
| **Variable** | `on` | `status` | Main binary state variable |
| **Variable** | `switch_on` | `startup` | Startup event variable |
| **Variable** | `switch_off` | `shutdown` | Shutdown event variable |
| **Variable** | `switch_on_nr` | `startup_count` | Cumulative startup counter |
| **Variable** | `on_hours_total` | `active_hours` | Total operating hours |
| **Variable** | `consecutive_on_hours` | `uptime` | Consecutive active hours |
| **Variable** | `consecutive_off_hours` | `downtime` | Consecutive inactive hours |
| **Variable** | `off` | `inactive` | Deprecated - use `1 - status` instead |

**Flow and Component API:**

| Category | Old Name | New Name | Location |
|----------|----------|----------|----------|
| **Parameter** | `on_off_parameters` | `status_parameters` | `Flow.__init__()` |
| **Parameter** | `on_off_parameters` | `status_parameters` | `Component.__init__()` |
| **Property** | `flow.submodel.on_off` | `flow.submodel.status` | Flow submodel access |
| **Property** | `component.submodel.on_off` | `component.submodel.status` | Component submodel access |

**Internal Properties:**

| Old Name | New Name |
|----------|----------|
| `use_switch_on` | `use_startup_tracking` |
| `use_consecutive_on_hours` | `use_uptime_tracking` |
| `use_consecutive_off_hours` | `use_downtime_tracking` |
| `with_on_off` | `with_status` |
| `previous_states` | `previous_status` |

**Migration Guide**:

Use find-and-replace to update your code with the mappings above. The functionality is identical - only naming has changed.

**Important**: This is a complete renaming with no backwards compatibility. The change affects:
- Constructor parameter names
- Model variable names and property access
- Results access patterns

A partial backwards compatibility wrapper would be misleading, so we opted for a clean breaking change.

### ♻️ Changed

### 🗑️ Deprecated
Expand Down
2 changes: 1 addition & 1 deletion docs/user-guide/core-concepts.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Element labels must be unique across all types. See the [`FlowSystem` API refere

- Have a `size` which, generally speaking, defines how much energy or material can be moved. Usually measured in MW, kW, m³/h, etc.
- Have a `flow_rate`, which defines how fast energy or material is transported. Usually measured in MW, kW, m³/h, etc.
- Have constraints to limit the flow-rate (min/max, total flow hours, on/off etc.)
- Have constraints to limit the flow-rate (min/max, total flow hours, active/inactive status etc.)
- Can have fixed profiles (for demands or renewable generation)
- Can have [Effects](#effects) associated by their use (costs, emissions, labour, ...)

Expand Down
2 changes: 1 addition & 1 deletion docs/user-guide/mathematical-notation/dimensions.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ Scenarios within a period are **operationally independent**:
- Each scenario has its own operational variables: $p(\text{t}_i, s_1)$ and $p(\text{t}_i, s_2)$ are independent
- Scenarios cannot exchange energy, information, or resources
- Storage states are separate: $c(\text{t}_i, s_1) \neq c(\text{t}_i, s_2)$
- Binary states (on/off) are independent: $s(\text{t}_i, s_1)$ vs $s(\text{t}_i, s_2)$
- Binary states (active/inactive) are independent: $s(\text{t}_i, s_1)$ vs $s(\text{t}_i, s_2)$

Scenarios are connected **only through the objective function** via weights:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
**Example:**

[`Flows`][flixopt.elements.Flow] have an attribute `effects_per_flow_hour` that defines the effect contribution per flow-hour:

- Costs (€/kWh)
- Emissions (kg CO₂/kWh)
- Primary energy consumption (kWh_primary/kWh)
Expand Down Expand Up @@ -260,6 +261,7 @@ $$
$$

Where:

- $\mathcal{S}$ is the set of scenarios
- $w_s$ is the weight for scenario $s$ (typically scenario probability)
- Periodic effects are **shared across scenarios**: $E_{\Omega,\text{per}}$ and $E_{\Phi,\text{per}}$ (same for all $s$)
Expand All @@ -280,6 +282,7 @@ $$
$$

Where:

- $\mathcal{Y}$ is the set of periods (e.g., years)
- $w_y$ is the weight for period $y$ (typically annual discount factor)
- Each period $y$ has **independent** periodic and temporal effects (including penalty)
Expand All @@ -295,6 +298,7 @@ $$
$$

Where:

- $\mathcal{S}$ is the set of scenarios
- $\mathcal{Y}$ is the set of periods
- $w_y$ is the period weight (for periodic effects)
Expand Down
11 changes: 6 additions & 5 deletions docs/user-guide/mathematical-notation/elements/Flow.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ $$
$$


This mathematical formulation can be extended by using [OnOffParameters](../features/OnOffParameters.md)
to define the on/off state of the Flow, or by using [InvestParameters](../features/InvestParameters.md)
This mathematical formulation can be extended by using [StatusParameters](../features/StatusParameters.md)
to define the active/inactive state of the Flow, or by using [InvestParameters](../features/InvestParameters.md)
to change the size of the Flow from a constant to an optimization variable.

---
Expand All @@ -34,7 +34,7 @@ to change the size of the Flow from a constant to an optimization variable.
Flow formulation uses the following modeling patterns:

- **[Scaled Bounds](../modeling-patterns/bounds-and-states.md#scaled-bounds)** - Basic flow rate bounds (equation $\eqref{eq:flow_rate}$)
- **[Scaled Bounds with State](../modeling-patterns/bounds-and-states.md#scaled-bounds-with-state)** - When combined with [OnOffParameters](../features/OnOffParameters.md)
- **[Scaled Bounds with State](../modeling-patterns/bounds-and-states.md#scaled-bounds-with-state)** - When combined with [StatusParameters](../features/StatusParameters.md)
- **[Bounds with State](../modeling-patterns/bounds-and-states.md#bounds-with-state)** - Investment decisions with [InvestParameters](../features/InvestParameters.md)

---
Expand All @@ -44,19 +44,20 @@ Flow formulation uses the following modeling patterns:
**Python Class:** [`Flow`][flixopt.elements.Flow]

**Key Parameters:**

- `size`: Flow size $\text{P}$ (can be fixed or variable with InvestParameters)
- `relative_minimum`, `relative_maximum`: Relative bounds $\text{p}^{\text{L}}_{\text{rel}}, \text{p}^{\text{U}}_{\text{rel}}$
- `effects_per_flow_hour`: Operational effects (costs, emissions, etc.)
- `invest_parameters`: Optional investment modeling (see [InvestParameters](../features/InvestParameters.md))
- `on_off_parameters`: Optional on/off operation (see [OnOffParameters](../features/OnOffParameters.md))
- `status_parameters`: Optional active/inactive operation (see [StatusParameters](../features/StatusParameters.md))

See the [`Flow`][flixopt.elements.Flow] API documentation for complete parameter list and usage examples.

---

## See Also

- [OnOffParameters](../features/OnOffParameters.md) - Binary on/off operation
- [StatusParameters](../features/StatusParameters.md) - Binary active/inactive operation
- [InvestParameters](../features/InvestParameters.md) - Variable flow sizing
- [Bus](../elements/Bus.md) - Flow balance constraints
- [LinearConverter](../elements/LinearConverter.md) - Flow ratio constraints
Expand Down
2 changes: 2 additions & 0 deletions docs/user-guide/mathematical-notation/elements/Storage.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ Storage formulation uses the following modeling patterns:
- **[Scaled Bounds](../modeling-patterns/bounds-and-states.md#scaled-bounds)** - For flow rate bounds relative to storage size

When combined with investment parameters, storage can use:

- **[Bounds with State](../modeling-patterns/bounds-and-states.md#bounds-with-state)** - Investment decisions (see [InvestParameters](../features/InvestParameters.md))

---
Expand All @@ -62,6 +63,7 @@ When combined with investment parameters, storage can use:
**Python Class:** [`Storage`][flixopt.components.Storage]

**Key Parameters:**

- `capacity_in_flow_hours`: Storage capacity $\text{C}$
- `relative_loss_per_hour`: Self-discharge rate $\dot{\text{c}}_\text{rel,loss}$
- `initial_charge_state`: Initial charge $c(\text{t}_0)$
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ v_\text{invest} = s_\text{invest} \cdot \text{size}_\text{fixed}
$$

With:

- $v_\text{invest}$ being the resulting investment size
- $s_\text{invest} \in \{0, 1\}$ being the binary investment decision
- $\text{size}_\text{fixed}$ being the predefined component size
Expand All @@ -34,6 +35,7 @@ s_\text{invest} \cdot \text{size}_\text{min} \leq v_\text{invest} \leq s_\text{i
$$

With:

- $v_\text{invest}$ being the investment size variable (continuous)
- $s_\text{invest} \in \{0, 1\}$ being the binary investment decision
- $\text{size}_\text{min}$ being the minimum investment size (if investing)
Expand Down Expand Up @@ -80,6 +82,7 @@ E_{e,\text{fix}} = s_\text{invest} \cdot \text{fix}_e
$$

With:

- $E_{e,\text{fix}}$ being the fixed contribution to effect $e$
- $\text{fix}_e$ being the fixed effect value (e.g., fixed installation cost)

Expand All @@ -99,6 +102,7 @@ E_{e,\text{spec}} = v_\text{invest} \cdot \text{spec}_e
$$

With:

- $E_{e,\text{spec}}$ being the size-dependent contribution to effect $e$
- $\text{spec}_e$ being the specific effect value per unit size (e.g., €/kW)

Expand All @@ -123,6 +127,7 @@ v_\text{invest} = \sum_{k=1}^{K} \lambda_k \cdot v_k
$$

With:

- $E_{e,\text{pw}}$ being the piecewise contribution to effect $e$
- $\lambda_k$ being the piecewise lambda variables (see [Piecewise](../features/Piecewise.md))
- $r_{e,k}$ being the effect rate at piece $k$
Expand All @@ -146,6 +151,7 @@ E_{e,\text{retirement}} = (1 - s_\text{invest}) \cdot \text{retirement}_e
$$

With:

- $E_{e,\text{retirement}}$ being the retirement contribution to effect $e$
- $\text{retirement}_e$ being the retirement effect value

Expand Down Expand Up @@ -210,6 +216,7 @@ $$\label{eq:annualization}
$$

With:

- $\text{cost}_\text{capital}$ being the upfront investment cost
- $r$ being the discount rate
- $n$ being the equipment lifetime in years
Expand All @@ -226,6 +233,7 @@ $$
**Python Class:** [`InvestParameters`][flixopt.interface.InvestParameters]

**Key Parameters:**

- `fixed_size`: For binary investments (mutually exclusive with continuous sizing)
- `minimum_size`, `maximum_size`: For continuous sizing
- `mandatory`: Whether investment is required (default: `False`)
Expand Down
Loading