Skip to content

Commit 7fce992

Browse files
committed
Merge remote-tracking branch 'origin/feature/v5' into feature/docs-improvement
# Conflicts: # CHANGELOG.md
2 parents 4b13595 + 4ca07f6 commit 7fce992

12 files changed

Lines changed: 44 additions & 2068 deletions

CHANGELOG.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,48 @@ Until here -->
5353

5454
## [Upcoming]
5555

56+
### 🔥 Removed
57+
58+
**Deprecated parameters removed** (all were deprecated in v4.0.0 or earlier):
59+
60+
**TimeSeriesData:**
61+
- `agg_group` → use `aggregation_group`
62+
- `agg_weight` → use `aggregation_weight`
63+
- Properties: `agg_group`, `agg_weight`
64+
65+
**Effect:**
66+
- Constructor parameters: `minimum_operation` → use `minimum_temporal`, `maximum_operation` → use `maximum_temporal`, `minimum_invest` → use `minimum_periodic`, `maximum_invest` → use `maximum_periodic`, `minimum_operation_per_hour` → use `minimum_per_hour`, `maximum_operation_per_hour` → use `maximum_per_hour`
67+
- Properties: `minimum_operation`, `maximum_operation`, `minimum_invest`, `maximum_invest`, `minimum_operation_per_hour`, `maximum_operation_per_hour`, `minimum_total_per_period`, `maximum_total_per_period`
68+
69+
**Flow:**
70+
- Constructor parameters: `flow_hours_per_period_max` → use `flow_hours_max`, `flow_hours_per_period_min` → use `flow_hours_min`, `flow_hours_total_max` → use `flow_hours_max`, `flow_hours_total_min` → use `flow_hours_min`, `total_flow_hours_max` → use `flow_hours_max_over_periods`, `total_flow_hours_min` → use `flow_hours_min_over_periods`
71+
- Properties: `flow_hours_total_max`, `flow_hours_total_min`
72+
73+
**InvestParameters:**
74+
- Constructor parameters: `fix_effects` → use `effects_of_investment`, `specific_effects` → use `effects_of_investment_per_size`, `divest_effects` → use `effects_of_retirement`, `piecewise_effects` → use `piecewise_effects_of_investment`, `optional` → use `mandatory` (with inverted logic)
75+
- Properties: `optional`, `fix_effects`, `specific_effects`, `divest_effects`, `piecewise_effects`
76+
77+
**OnOffParameters:**
78+
- Constructor parameters: `on_hours_total_min` → use `on_hours_min`, `on_hours_total_max` → use `on_hours_max`, `switch_on_total_max` → use `switch_on_max`
79+
80+
**Storage:**
81+
- `initial_charge_state="lastValueOfSim"` → use `initial_charge_state="equals_final"`
82+
83+
**Source, Sink, SourceAndSink:**
84+
- Constructor parameters:
85+
- Source: `source` → use `outputs`
86+
- Sink: `sink` → use `inputs`
87+
- SourceAndSink: `source` → use `outputs`, `sink` → use `inputs`, `prevent_simultaneous_sink_and_source` → use `prevent_simultaneous_flow_rates`
88+
- Properties:
89+
- Source: `source` property
90+
- Sink: `sink` property
91+
- SourceAndSink: `source`, `sink`, `prevent_simultaneous_sink_and_source` properties
92+
93+
**Linear Converters** (Boiler, CHP, HeatPump, etc.):
94+
- Flow parameters: `Q_fu` → use `fuel_flow`, `P_el` → use `electrical_flow`, `Q_th` → use `thermal_flow`, `Q_ab` → use `heat_source_flow`
95+
- Efficiency parameters: `eta` → use `thermal_efficiency`, `eta_th` → use `thermal_efficiency`, `eta_el` → use `electrical_efficiency`, `COP` → use `cop`
96+
97+
5698
### 📝 Docs
5799
- Improve documentation from the ground up
58100

bot-test.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

flixopt/components.py

Lines changed: 0 additions & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,12 @@
55
from __future__ import annotations
66

77
import logging
8-
import warnings
98
from typing import TYPE_CHECKING, Literal
109

1110
import numpy as np
1211
import xarray as xr
1312

1413
from . import io as fx_io
15-
from .config import DEPRECATION_REMOVAL_VERSION
1614
from .core import PlausibilityError
1715
from .elements import Component, ComponentModel, Flow
1816
from .features import InvestmentModel, PiecewiseModel
@@ -404,14 +402,6 @@ def __init__(
404402
prevent_simultaneous_flows=[charging, discharging] if prevent_simultaneous_charge_and_discharge else None,
405403
meta_data=meta_data,
406404
)
407-
if isinstance(initial_charge_state, str) and initial_charge_state == 'lastValueOfSim':
408-
warnings.warn(
409-
f'{initial_charge_state=} is deprecated. Use "equals_final" instead. '
410-
f'Will be removed in v{DEPRECATION_REMOVAL_VERSION}.',
411-
DeprecationWarning,
412-
stacklevel=2,
413-
)
414-
initial_charge_state = 'equals_final'
415405

416406
self.charging = charging
417407
self.discharging = discharging
@@ -1102,22 +1092,7 @@ def __init__(
11021092
outputs: list[Flow] | None = None,
11031093
prevent_simultaneous_flow_rates: bool = True,
11041094
meta_data: dict | None = None,
1105-
**kwargs,
11061095
):
1107-
# Handle deprecated parameters using centralized helper
1108-
outputs = self._handle_deprecated_kwarg(kwargs, 'source', 'outputs', outputs, transform=lambda x: [x])
1109-
inputs = self._handle_deprecated_kwarg(kwargs, 'sink', 'inputs', inputs, transform=lambda x: [x])
1110-
prevent_simultaneous_flow_rates = self._handle_deprecated_kwarg(
1111-
kwargs,
1112-
'prevent_simultaneous_sink_and_source',
1113-
'prevent_simultaneous_flow_rates',
1114-
prevent_simultaneous_flow_rates,
1115-
check_conflict=False,
1116-
)
1117-
1118-
# Validate any remaining unexpected kwargs
1119-
self._validate_kwargs(kwargs)
1120-
11211096
super().__init__(
11221097
label,
11231098
inputs=inputs,
@@ -1127,36 +1102,6 @@ def __init__(
11271102
)
11281103
self.prevent_simultaneous_flow_rates = prevent_simultaneous_flow_rates
11291104

1130-
@property
1131-
def source(self) -> Flow:
1132-
warnings.warn(
1133-
'The source property is deprecated. Use the outputs property instead. '
1134-
f'Will be removed in v{DEPRECATION_REMOVAL_VERSION}.',
1135-
DeprecationWarning,
1136-
stacklevel=2,
1137-
)
1138-
return self.outputs[0]
1139-
1140-
@property
1141-
def sink(self) -> Flow:
1142-
warnings.warn(
1143-
'The sink property is deprecated. Use the inputs property instead. '
1144-
f'Will be removed in v{DEPRECATION_REMOVAL_VERSION}.',
1145-
DeprecationWarning,
1146-
stacklevel=2,
1147-
)
1148-
return self.inputs[0]
1149-
1150-
@property
1151-
def prevent_simultaneous_sink_and_source(self) -> bool:
1152-
warnings.warn(
1153-
'The prevent_simultaneous_sink_and_source property is deprecated. Use the prevent_simultaneous_flow_rates property instead. '
1154-
f'Will be removed in v{DEPRECATION_REMOVAL_VERSION}.',
1155-
DeprecationWarning,
1156-
stacklevel=2,
1157-
)
1158-
return self.prevent_simultaneous_flow_rates
1159-
11601105

11611106
@register_class_for_io
11621107
class Source(Component):
@@ -1240,14 +1185,7 @@ def __init__(
12401185
outputs: list[Flow] | None = None,
12411186
meta_data: dict | None = None,
12421187
prevent_simultaneous_flow_rates: bool = False,
1243-
**kwargs,
12441188
):
1245-
# Handle deprecated parameter using centralized helper
1246-
outputs = self._handle_deprecated_kwarg(kwargs, 'source', 'outputs', outputs, transform=lambda x: [x])
1247-
1248-
# Validate any remaining unexpected kwargs
1249-
self._validate_kwargs(kwargs)
1250-
12511189
self.prevent_simultaneous_flow_rates = prevent_simultaneous_flow_rates
12521190
super().__init__(
12531191
label,
@@ -1256,16 +1194,6 @@ def __init__(
12561194
prevent_simultaneous_flows=outputs if prevent_simultaneous_flow_rates else None,
12571195
)
12581196

1259-
@property
1260-
def source(self) -> Flow:
1261-
warnings.warn(
1262-
'The source property is deprecated. Use the outputs property instead. '
1263-
f'Will be removed in v{DEPRECATION_REMOVAL_VERSION}.',
1264-
DeprecationWarning,
1265-
stacklevel=2,
1266-
)
1267-
return self.outputs[0]
1268-
12691197

12701198
@register_class_for_io
12711199
class Sink(Component):
@@ -1350,29 +1278,16 @@ def __init__(
13501278
inputs: list[Flow] | None = None,
13511279
meta_data: dict | None = None,
13521280
prevent_simultaneous_flow_rates: bool = False,
1353-
**kwargs,
13541281
):
13551282
"""Initialize a Sink (consumes flow from the system).
13561283
1357-
Supports legacy `sink=` keyword for backward compatibility (deprecated): if `sink` is provided
1358-
it is used as the single input flow and a DeprecationWarning is issued; specifying both
1359-
`inputs` and `sink` raises ValueError.
1360-
13611284
Args:
13621285
label: Unique element label.
13631286
inputs: Input flows for the sink.
13641287
meta_data: Arbitrary metadata attached to the element.
13651288
prevent_simultaneous_flow_rates: If True, prevents simultaneous nonzero flow rates
13661289
across the element's inputs by wiring that restriction into the base Component setup.
1367-
1368-
Note:
1369-
The deprecated `sink` kwarg is accepted for compatibility but will be removed in future releases.
13701290
"""
1371-
# Handle deprecated parameter using centralized helper
1372-
inputs = self._handle_deprecated_kwarg(kwargs, 'sink', 'inputs', inputs, transform=lambda x: [x])
1373-
1374-
# Validate any remaining unexpected kwargs
1375-
self._validate_kwargs(kwargs)
13761291

13771292
self.prevent_simultaneous_flow_rates = prevent_simultaneous_flow_rates
13781293
super().__init__(
@@ -1381,13 +1296,3 @@ def __init__(
13811296
meta_data=meta_data,
13821297
prevent_simultaneous_flows=inputs if prevent_simultaneous_flow_rates else None,
13831298
)
1384-
1385-
@property
1386-
def sink(self) -> Flow:
1387-
warnings.warn(
1388-
'The sink property is deprecated. Use the inputs property instead. '
1389-
f'Will be removed in v{DEPRECATION_REMOVAL_VERSION}.',
1390-
DeprecationWarning,
1391-
stacklevel=2,
1392-
)
1393-
return self.inputs[0]

flixopt/core.py

Lines changed: 0 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,6 @@ def __init__(
4343
*args: Any,
4444
clustering_group: str | None = None,
4545
clustering_weight: float | None = None,
46-
aggregation_group: str | None = None,
47-
aggregation_weight: float | None = None,
48-
agg_group: str | None = None,
49-
agg_weight: float | None = None,
5046
**kwargs: Any,
5147
):
5248
"""
@@ -56,48 +52,8 @@ def __init__(
5652
clustering weight (1/n where n is the number of series in the group). Mutually exclusive with clustering_weight.
5753
clustering_weight: Clustering weight (0-1). Use this to assign a specific weight to a single time series.
5854
Mutually exclusive with clustering_group.
59-
aggregation_group: Deprecated, use clustering_group instead
60-
aggregation_weight: Deprecated, use clustering_weight instead
61-
agg_group: Deprecated, use clustering_group instead
62-
agg_weight: Deprecated, use clustering_weight instead
6355
**kwargs: Additional arguments passed to DataArray
6456
"""
65-
# Handle deprecated parameters
66-
if agg_group is not None:
67-
warnings.warn(
68-
f'agg_group is deprecated, use clustering_group instead. '
69-
f'Will be removed in v{DEPRECATION_REMOVAL_VERSION}.',
70-
DeprecationWarning,
71-
stacklevel=2,
72-
)
73-
clustering_group = agg_group
74-
if aggregation_group is not None:
75-
warnings.warn(
76-
f'aggregation_group is deprecated, use clustering_group instead. '
77-
f'Will be removed in v{DEPRECATION_REMOVAL_VERSION}.',
78-
DeprecationWarning,
79-
stacklevel=2,
80-
)
81-
if clustering_group is None:
82-
clustering_group = aggregation_group
83-
84-
if agg_weight is not None:
85-
warnings.warn(
86-
f'agg_weight is deprecated, use clustering_weight instead. '
87-
f'Will be removed in v{DEPRECATION_REMOVAL_VERSION}.',
88-
DeprecationWarning,
89-
stacklevel=2,
90-
)
91-
clustering_weight = agg_weight
92-
if aggregation_weight is not None:
93-
warnings.warn(
94-
f'aggregation_weight is deprecated, use clustering_weight instead. '
95-
f'Will be removed in v{DEPRECATION_REMOVAL_VERSION}.',
96-
DeprecationWarning,
97-
stacklevel=2,
98-
)
99-
if clustering_weight is None:
100-
clustering_weight = aggregation_weight
10157

10258
if (clustering_group is not None) and (clustering_weight is not None):
10359
raise ValueError('Use either clustering_group or clustering_weight, not both')
@@ -198,48 +154,6 @@ def __repr__(self):
198154
info_str = f'TimeSeriesData({", ".join(clustering_info)})' if clustering_info else 'TimeSeriesData'
199155
return f'{info_str}\n{super().__repr__()}'
200156

201-
@property
202-
def aggregation_group(self):
203-
"""Deprecated: Use clustering_group instead."""
204-
warnings.warn(
205-
f'aggregation_group is deprecated, use clustering_group instead. '
206-
f'Will be removed in v{DEPRECATION_REMOVAL_VERSION}.',
207-
DeprecationWarning,
208-
stacklevel=2,
209-
)
210-
return self.clustering_group
211-
212-
@property
213-
def aggregation_weight(self):
214-
"""Deprecated: Use clustering_weight instead."""
215-
warnings.warn(
216-
f'aggregation_weight is deprecated, use clustering_weight instead. '
217-
f'Will be removed in v{DEPRECATION_REMOVAL_VERSION}.',
218-
DeprecationWarning,
219-
stacklevel=2,
220-
)
221-
return self.clustering_weight
222-
223-
@property
224-
def agg_group(self):
225-
warnings.warn(
226-
f'agg_group is deprecated, use clustering_group instead. '
227-
f'Will be removed in v{DEPRECATION_REMOVAL_VERSION}.',
228-
DeprecationWarning,
229-
stacklevel=2,
230-
)
231-
return self.clustering_group
232-
233-
@property
234-
def agg_weight(self):
235-
warnings.warn(
236-
f'agg_weight is deprecated, use clustering_weight instead. '
237-
f'Will be removed in v{DEPRECATION_REMOVAL_VERSION}.',
238-
DeprecationWarning,
239-
stacklevel=2,
240-
)
241-
return self.clustering_weight
242-
243157

244158
class DataConverter:
245159
"""

0 commit comments

Comments
 (0)