Skip to content

Commit

Permalink
Remove argument "invest" from GenericStorage
Browse files Browse the repository at this point in the history
  • Loading branch information
p-snft committed Aug 22, 2024
1 parent 0463b4d commit 2ffc0be
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 48 deletions.
15 changes: 0 additions & 15 deletions src/oemof/solph/components/_generic_storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,6 @@ def __init__(
outputs=None,
nominal_storage_capacity=None,
initial_storage_level=None,
investment=None,
invest_relation_input_output=None,
invest_relation_input_capacity=None,
invest_relation_output_capacity=None,
Expand Down Expand Up @@ -199,20 +198,6 @@ def __init__(
outputs=outputs,
custom_properties=custom_attributes,
)
# --- BEGIN: The following code can be removed for versions >= v0.6 ---
if investment is not None:
msg = (
"For backward compatibility,"
" the option investment overwrites the option"
+ " nominal_storage_capacity."
+ " Both options cannot be set at the same time."
)
if nominal_storage_capacity is not None:
raise AttributeError(msg)
else:
warn(msg, FutureWarning)
nominal_storage_capacity = investment
# --- END ---

self.nominal_storage_capacity = None
self.investment = None
Expand Down
33 changes: 0 additions & 33 deletions tests/test_components.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,28 +42,6 @@ def test_generic_storage_1():
)


def test_generic_storage_2():
"""Nominal value defined with investment model."""
bel = Bus()
with pytest.raises(
AttributeError,
match="For backward compatibility, the option investment overwrites",
):
components.GenericStorage(
label="storage3",
nominal_storage_capacity=45,
inputs={bel: Flow(variable_costs=10e10)},
outputs={bel: Flow(variable_costs=10e10)},
loss_rate=0.00,
initial_storage_level=0,
invest_relation_input_capacity=1 / 6,
invest_relation_output_capacity=1 / 6,
inflow_conversion_factor=1,
outflow_conversion_factor=0.8,
investment=Investment(ep_costs=23),
)


def test_generic_storage_3():
"""Nominal value defined with investment model."""
bel = Bus()
Expand Down Expand Up @@ -148,17 +126,6 @@ def test_generic_storage_with_convex_invest_offset():
)


def test_generic_storage_invest_warning():
with pytest.warns(FutureWarning):
bel = Bus()
components.GenericStorage(
label="storage7",
inputs={bel: Flow()},
outputs={bel: Flow()},
investment=Investment(),
)


def test_generic_storage_with_invest_and_fixed_losses_absolute():
"""
Storage with fixed losses in the investment mode but no minimum or existing
Expand Down

0 comments on commit 2ffc0be

Please sign in to comment.