Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
809b297
Rename effect domains
FBumann Sep 26, 2025
d69b1ca
Rename effect domains
FBumann Sep 26, 2025
8e44b93
Ensure backwards compatability
FBumann Sep 26, 2025
3966051
Improve
FBumann Sep 26, 2025
6d5b03f
Improve
FBumann Sep 26, 2025
ddcb6be
Bugfix IO with deprectaed params
FBumann Sep 27, 2025
de61895
Add guards for extra kwargs
FBumann Sep 27, 2025
115f3a0
Add guards for extra kwargs
FBumann Sep 27, 2025
4a82574
centralize logic for deprectaed params
FBumann Sep 27, 2025
9f4c1f6
Move handlign from centralized back to classes in a dedicated method
FBumann Sep 27, 2025
5fe2c64
Improce property handling
FBumann Sep 27, 2025
09bdeec
Move handling to Interface class
FBumann Sep 27, 2025
3c0db76
Getting lost
FBumann Sep 27, 2025
2f817d1
Revert "Getting lost"
FBumann Sep 27, 2025
fb0af15
Revert "Move handling to Interface class"
FBumann Sep 27, 2025
97b6295
Revert "Improce property handling"
FBumann Sep 27, 2025
2cc5e4c
Revert "Move handlign from centralized back to classes in a dedicated…
FBumann Sep 27, 2025
51bbe4e
Revert "centralize logic for deprectaed params"
FBumann Sep 27, 2025
4705a4f
Add "" to warnings
FBumann Sep 27, 2025
7dc51aa
Revert change in examples
FBumann Sep 27, 2025
b4d5e8b
Improve BackwardsCompatibleDataset
FBumann Sep 27, 2025
f5fbfc6
Add unit tests for backwards compatability
FBumann Sep 27, 2025
f6cfd6b
Remove backwards compatible dataset
FBumann Sep 27, 2025
b071671
Renamed maximum_temporal_per_hour to maximum_per_hour and minimum_tem…
FBumann Sep 27, 2025
02b8859
Add entires to CHANGELOG.md
FBumann Sep 27, 2025
59b5f22
Remove backwards compatible dataset
FBumann Sep 27, 2025
06f20e6
Remove unused imports
FBumann Sep 27, 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
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,13 @@ Please keep the format of the changelog consistent with the other releases, so t
### ♻️ Changed

### 🗑️ Deprecated
- Renamed `Effect` parameters:
- `minimum_investment` → `minimum_nontemporal`
- `maximum_investment` → `maximum_nontemporal`
- `minimum_operation` → `minimum_temporal`
- `maximum_operation` → `maximum_temporal`
- `minimum_operation_per_hour` → `minimum_per_hour`
- `maximum_operation_per_hour` → `maximum_per_hour`

### 🔥 Removed

Expand Down
4 changes: 2 additions & 2 deletions examples/03_Calculation_types/example_calculation_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,14 +204,14 @@ def get_solutions(calcs: list, variable: str) -> xr.Dataset:
).write_html('results/BHKW2 Thermal Power.html')

fx.plotting.with_plotly(
get_solutions(calculations, 'costs(operation)|total_per_timestep').to_dataframe(),
get_solutions(calculations, 'costs(temporal)|per_timestep').to_dataframe(),
mode='line',
title='Operation Cost Comparison',
ylabel='Costs [€]',
).write_html('results/Operation Costs.html')

fx.plotting.with_plotly(
pd.DataFrame(get_solutions(calculations, 'costs(operation)|total_per_timestep').to_dataframe().sum()).T,
pd.DataFrame(get_solutions(calculations, 'costs(temporal)|per_timestep').to_dataframe().sum()).T,
mode='bar',
title='Total Cost Comparison',
ylabel='Costs [€]',
Expand Down
4 changes: 2 additions & 2 deletions flixopt/calculation.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ def main_results(self) -> dict[str, Scalar | dict]:
'Penalty': float(self.model.effects.penalty.total.solution.values),
'Effects': {
f'{effect.label} [{effect.unit}]': {
'operation': float(effect.model.operation.total.solution.values),
'invest': float(effect.model.invest.total.solution.values),
'temporal': float(effect.model.temporal.total.solution.values),
'nontemporal': float(effect.model.nontemporal.total.solution.values),
'total': float(effect.model.total.solution.values),
}
for effect in self.flow_system.effects
Expand Down
19 changes: 14 additions & 5 deletions flixopt/components.py
Original file line number Diff line number Diff line change
Expand Up @@ -975,7 +975,7 @@ def __init__(
prevent_simultaneous_sink_and_source = kwargs.pop('prevent_simultaneous_sink_and_source', None)
if source is not None:
warnings.warn(
'The use of the source argument is deprecated. Use the outputs argument instead.',
'The use of the "source" argument is deprecated. Use the "outputs" argument instead.',
DeprecationWarning,
stacklevel=2,
)
Expand All @@ -985,7 +985,7 @@ def __init__(

if sink is not None:
warnings.warn(
'The use of the sink argument is deprecated. Use the inputs argument instead.',
'The use of the "sink" argument is deprecated. Use the "inputs" argument instead.',
DeprecationWarning,
stacklevel=2,
)
Expand All @@ -995,12 +995,15 @@ def __init__(

if prevent_simultaneous_sink_and_source is not None:
warnings.warn(
'The use of the prevent_simultaneous_sink_and_source argument is deprecated. Use the prevent_simultaneous_flow_rates argument instead.',
'The use of the "prevent_simultaneous_sink_and_source" argument is deprecated. Use the "prevent_simultaneous_flow_rates" argument instead.',
DeprecationWarning,
stacklevel=2,
)
prevent_simultaneous_flow_rates = prevent_simultaneous_sink_and_source

# Validate any remaining unexpected kwargs
self._validate_kwargs(kwargs)

super().__init__(
label,
inputs=inputs,
Expand Down Expand Up @@ -1125,14 +1128,17 @@ def __init__(
source = kwargs.pop('source', None)
if source is not None:
warnings.warn(
'The use of the source argument is deprecated. Use the outputs argument instead.',
'The use of the "source" argument is deprecated. Use the "outputs" argument instead.',
DeprecationWarning,
stacklevel=2,
)
if outputs is not None:
raise ValueError('Either source or outputs can be specified, but not both.')
outputs = [source]

# Validate any remaining unexpected kwargs
self._validate_kwargs(kwargs)

self.prevent_simultaneous_flow_rates = prevent_simultaneous_flow_rates
super().__init__(
label,
Expand Down Expand Up @@ -1253,14 +1259,17 @@ def __init__(
sink = kwargs.pop('sink', None)
if sink is not None:
warnings.warn(
'The use of the sink argument is deprecated. Use the inputs argument instead.',
'The use of the "sink" argument is deprecated. Use the "inputs" argument instead.',
DeprecationWarning,
stacklevel=2,
)
if inputs is not None:
raise ValueError('Either sink or inputs can be specified, but not both.')
inputs = [sink]

# Validate any remaining unexpected kwargs
self._validate_kwargs(kwargs)

self.prevent_simultaneous_flow_rates = prevent_simultaneous_flow_rates
super().__init__(
label,
Expand Down
Loading