Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Johannes Kochems <[email protected]>
  • Loading branch information
p-snft and jokochems authored Nov 25, 2024
1 parent 9b137cd commit b980167
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion docs/whatsnew/v0-6-0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ API changes
initial storage level is defined, the costs just offset the
objective value without changing anything else.
* The parameters `GenericStorage.nominal_storage_capacity` and
`Flow.nominal_capacity` are now both called `nominal_calacity`.
`Flow.nominal_capacity` are now both called `nominal_capacity`.

New features
############
Expand Down
4 changes: 2 additions & 2 deletions examples/tuple_as_labels/tuple_as_label.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,10 +240,10 @@ def main():
nominal_capacity=nominal_capacity,
label=Label("storage", "electricity", "battery"),
inputs={
bel: flows.Flow(nominal_capacity=nominal_storage_capacity / 6)
bel: flows.Flow(nominal_capacity=nominal_capacity / 6)
},
outputs={
bel: flows.Flow(nominal_capacity=nominal_storage_capacity / 6)
bel: flows.Flow(nominal_capacity=nominal_capacity / 6)
},
loss_rate=0.00,
initial_storage_level=None,
Expand Down
2 changes: 1 addition & 1 deletion src/oemof/solph/components/_generic_storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ def __init__(
if nominal_storage_capacity is not None:
msg = (
"For backward compatibility,"
" the option nominal_storage_capacity overwrites the option"
+ " the option nominal_storage_capacity overwrites the option"
+ " nominal_capacity."
+ " Both options cannot be set at the same time."
)
Expand Down
4 changes: 2 additions & 2 deletions src/oemof/solph/flows/_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,8 @@ def __init__(
if nominal_value is not None:
msg = (
"For backward compatibility,"
" the option nominal_value overwrites the option"
" nominal_capacity."
+ " the option nominal_value overwrites the option"
+ " nominal_capacity."
+ " Both options cannot be set at the same time."
)
if nominal_capacity is not None:
Expand Down
2 changes: 1 addition & 1 deletion tests/test_flows/test_simple_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def test_full_load_time_min():

# --- BEGIN: The following code can be removed for versions >= v0.7 ---
def test_nominal_capacity_warning():
with pytest.warns(FutureWarning, match="nominal_capacity"):
with pytest.warns(FutureWarning, match="nominal_value"):
_ = solph.flows.Flow(nominal_value=2)


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ def test_optimise_storage_size(
label="pp_gas",
inputs={bgas: solph.flows.Flow()},
outputs={
bel: solph.flows.Flow(nominal_capacity=10e10, variable_costs=50)
bel: solph.flows.Flow(nominal_capacity=1e11, variable_costs=50)
},
conversion_factors={bel: 0.58},
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ def test_variable_chp(filename="variable_chp.csv", solver="cbc"):
energysystem.add(
solph.components.Converter(
label=("fixed_chp", "gas"),
inputs={bgas: solph.flows.Flow(nominal_capacity=10e10)},
inputs={bgas: solph.flows.Flow(nominal_capacity=1e11)},
outputs={bel2: solph.flows.Flow(), bth2: solph.flows.Flow()},
conversion_factors={bel2: 0.3, bth2: 0.5},
)
Expand All @@ -140,7 +140,7 @@ def test_variable_chp(filename="variable_chp.csv", solver="cbc"):
energysystem.add(
solph.components.ExtractionTurbineCHP(
label=("variable_chp", "gas"),
inputs={bgas: solph.flows.Flow(nominal_capacity=10e10)},
inputs={bgas: solph.flows.Flow(nominal_capacity=1e11)},
outputs={bel: solph.flows.Flow(), bth: solph.flows.Flow()},
conversion_factors={bel: 0.3, bth: 0.5},
conversion_factor_full_condensation={bel: 0.5},
Expand Down

0 comments on commit b980167

Please sign in to comment.