You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -51,146 +51,109 @@ If upgrading from v2.x, see the [v3.0.0 release notes](https://github.com/flixOp
51
51
52
52
## [Unreleased] - ????-??-??
53
53
54
-
**Summary**: Renaming parameters in Linear Transformers for readability (old parameters still work but emit warnings), new bounds for weighted sums over all periods for effects and flow hours, and refactored weights handling to fix `.sel()` issues with periods.
54
+
**Summary**:
55
55
56
56
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/).
57
57
58
58
### ✨ Added
59
-
- **Internal period weight computation**: `FlowSystem` now automatically computes `period_weights` from the period index (similar to `hours_per_timestep` for time dimension), ensuring weights are always consistent with the actual periods
60
59
61
-
- **New constraint parameters for sum across all periods**:
62
-
- `Effect`: Added `minimum_over_periods` and `maximum_over_periods` for weighted sum constraints across all periods (complements existing per-period `minimum_total`/`maximum_total`)
63
-
- `Flow`: Added `flow_hours_max_over_periods` and `flow_hours_min_over_periods` for weighted sum constraints across all periods
60
+
### 💥 Breaking Changes
61
+
62
+
### ♻️ Changed
63
+
64
+
### 🗑️ Deprecated
65
+
66
+
### 🔥 Removed
67
+
68
+
### 🐛 Fixed
69
+
70
+
### 🔒 Security
71
+
72
+
### 📦 Dependencies
73
+
74
+
### 📝 Docs
75
+
76
+
### 👷 Development
77
+
78
+
### 🚧 Known Issues
79
+
80
+
---
81
+
82
+
Until here -->
64
83
65
-
**Important**:
66
-
- Constraints with the `_over_periods` suffix compute weighted sums across all periods using the **raw** weights from period durations (or user-specified weights). These constraints always use unnormalized weights.
67
-
- The `normalize_weights` parameter (in `Calculation` or `FlowSystem.create_model()`) only affects the objective function, not the `_over_periods` constraints.
68
-
- Per-period constraints (without the suffix) apply separately to each individual period.
84
+
## [4.0.0] - 2025-11-19
69
85
70
-
**Example**:
71
-
```python
72
-
# Per-period constraint: limits apply to EACH period individually
73
-
# With periods=[2020, 2030, 2040], this creates 3 separate constraints
74
-
effect = fx.Effect('costs', maximum_total=1000) # ≤1000 in 2020 AND ≤1000 in 2030 AND ≤1000 in 2040
86
+
**Summary**: This release introduces clearer parameter naming for linear converters and constraints, enhanced period handling with automatic weight computation, and new sum-over-all-periods constraints for multi-period optimization. All deprecated parameter names continue to work with warnings.
75
87
76
-
# Over-periods constraint: limits apply to WEIGHTED SUM across ALL periods
77
-
# With periods=[2020, 2030, 2040] (auto-derived weights: [10, 10, 10] from 10-year intervals)
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/).
89
+
90
+
### ✨ Key Features
79
91
80
-
# Note: If normalize_weights=True, the objective uses normalized weights [0.33, 0.33, 0.33],
81
-
# but the constraint above still uses raw weights [10, 10, 10]
82
-
```
92
+
**Sum-over-all-periods constraints:**
93
+
New constraint parameters enable limiting weighted totals across all periods:
94
+
-`Effect`: `minimum_over_periods` and `maximum_over_periods`
95
+
-`Flow`: `flow_hours_max_over_periods` and `flow_hours_min_over_periods`
83
96
84
-
- **Auto-modeling**: `Calculation.solve()` now automatically calls `do_modeling()` if not already done, making the explicit `do_modeling()` call optional for simpler workflows
97
+
```python
98
+
# Per-period: limits apply to EACH period individually
99
+
effect = fx.Effect('costs', maximum_total=1000) # ≤1000 per period
100
+
101
+
# Over-periods: limits apply to WEIGHTED SUM across ALL periods
102
+
# With periods=[2020, 2030, 2040] (weights: [10, 10, 10] from 10-year intervals)
- Period weights now computed automatically from period index (like `hours_per_timestep` for time)
108
+
- Weights correctly recalculate when using `.sel()` or `.isel()` on periods
109
+
- Separate tracking of `period_weights`, `scenario_weights`, and combined `weights`
110
+
111
+
**Simplified workflow:**
112
+
-`Calculation.solve()` now automatically calls `do_modeling()` if needed
85
113
86
114
### 💥 Breaking Changes
87
-
- **FlowSystem weights parameter renamed**: The `weights` parameter in `FlowSystem.__init__()` has been renamed to `scenario_weights` to clarify that it only accepts scenario dimension weights (not period × scenario)
88
-
- Period weights are now **always computed internally** from the period index (similar to `hours_per_timestep` for time)
89
-
- The combined `weights` (period × scenario) are computed automatically by multiplying `period_weights × scenario_weights`
90
-
- only scenario_weights are normalized in the objective function
Period weights are now always computed from the period index.
103
125
104
126
**Note**: If you were previously passing period × scenario weights to `weights`, you now need to:
105
127
1. Pass only scenario weights to `scenario_weights`
106
128
2. Period weights will be computed automatically from your `periods` index
107
129
108
-
### ♻️ Changed
109
-
- **Period weights now computed from period index**: FlowSystem now computes `period_weights` automatically from the period index (using period intervals/differences), making weight handling consistent with `hours_per_timestep` for time dimension
110
-
- Added `_update_period_metadata()` method (analogous to `_update_time_metadata()`) to recalculate weights when periods are selected
111
-
- Period weights are stored separately in `FlowSystem.period_weights` (1D array with 'period' dimension)
112
-
- Scenario weights are stored in `FlowSystem.scenario_weights` (1D array with 'scenario' dimension)
113
-
- Combined weights `FlowSystem.weights` (2D array with 'period' and 'scenario' dimensions) are computed via `_compute_weights()` method
114
-
115
-
- **Refactored FlowSystem-Element coupling**:
116
-
- Introduced `_set_flow_system()` method in Interface base class to propagate FlowSystem reference to nested Interface objects
117
-
- Each Interface subclass now explicitly propagates the reference to its nested interfaces (e.g., Component → OnOffParameters, Flow → InvestParameters)
118
-
- Elements can now access FlowSystem via `self.flow_system` property instead of passing it through every method call
119
-
- **Simplified transform_data() signature**: Removed `flow_system` parameter from `transform_data()` methods - FlowSystem reference is now accessed via `self.flow_system` property
120
-
- **Two-phase modeling pattern within _do_modeling()**: Clarified the pattern where `_do_modeling()` creates nested submodels first (so their variables exist), then creates constraints that reference those variables - eliminates circular dependencies in Submodel architecture
121
-
- **Improved cache invalidation**: Cache invalidation in `add_elements()` now happens once after all additions rather than per element
122
-
- **Better logging**: Centralized element registration logging to show element type and full label
123
-
- **Parameter renaming in `linear_converters.py`**: Renamed parameters to use lowercase, descriptive names for better consistency and clarity:
- **Old parameter names in `linear_converters.py`**: The following parameter names are now deprecated and accessible as properties/kwargs that emit `DeprecationWarning`. They will be removed in v4.0.0:
All deprecated parameter names continue to work with deprecation warnings for backward compatibility. **Deprecated names will be removed in version 4.0.0.** Please update your code to use the new parameter names. Additional property aliases have been added internally to handle various naming variations that may have been used.
All deprecated names continue working with warnings. **They will be removed in v5.0.0.**
171
144
172
145
### 🐛 Fixed
173
-
- **Fixed weights not recalculating when using `.sel()` on periods**: `FlowSystem.sel()` and `FlowSystem.isel()` now correctly recalculate `period_weights` and `weights` when selecting a subset of periods (previously weights would be incorrectly sliced instead of recomputed from the new period index)
174
-
- Added `_update_period_metadata()` call in `_dataset_sel()` and `_dataset_isel()` to ensure weights stay consistent with selected periods
175
-
- This matches the existing behavior for time dimension where `hours_per_timestep` is recalculated on selection
176
-
177
-
- Fixed inconsistent argument passing in `_fit_effect_coords()` - standardized all calls to use named arguments (`prefix=`, `effect_values=`, `suffix=`) instead of mix of positional and named arguments
178
-
- Fixed `check_bounds` function in `linear_converters.py` to normalize array inputs before comparisons, ensuring correct boundary checks with DataFrames, Series, and other array-like types
146
+
- Fixed inconsistent boundary checks in linear converters with array-like inputs
179
147
180
148
### 👷 Development
181
-
- **Eliminated circular dependencies**: Implemented two-phase modeling pattern within `_do_modeling()` where nested submodels are created first (creating their variables), then constraints are created that can safely reference those submodel variables
182
-
- Added comprehensive docstrings to `_do_modeling()` methods explaining the pattern: "Create variables, constraints, and nested submodels"
183
-
- Added missing type hints throughout the codebase
184
-
- Improved code organization by making FlowSystem reference propagation explicit and traceable
185
-
- **System validation**: Added `_validate_system_integrity()` to validate cross-element references (e.g., Flow.bus) immediately after transformation, providing clearer error messages
186
-
- **Element registration validation**: Added checks to prevent elements from being assigned to multiple FlowSystems simultaneously
187
-
- **Helper methods in Interface base class**: Added `_fit_coords()` and `_fit_effect_coords()` convenience wrappers for cleaner data transformation code
188
-
- **FlowSystem property in Interface**: Added `flow_system` property to access the linked FlowSystem with clear error messages if not yet linked
149
+
- Eliminated circular dependencies with two-phase modeling pattern
150
+
- Enhanced validation for cross-element references and FlowSystem assignment
151
+
- Added helper methods for cleaner data transformation code
152
+
- Improved logging and cache invalidation
153
+
- Improved argument consistency in internal effect coordinate fitting
189
154
190
155
---
191
156
192
-
Until here -->
193
-
194
157
## [3.6.1] - 2025-11-17
195
158
196
159
**Summary**: Documentation improvements and dependency updates.
0 commit comments