Skip to content
Closed
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
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