Skip to content

Commit

Permalink
Adhere to Black
Browse files Browse the repository at this point in the history
  • Loading branch information
p-snft committed Dec 15, 2023
1 parent 8ead2b3 commit 213b164
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 27 deletions.
2 changes: 1 addition & 1 deletion src/oemof/solph/_energy_system.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def __init__(
infer_last_interval=None,
periods=None,
use_remaining_value=False,
groupings = None,
groupings=None,
):
# Doing imports at runtime is generally frowned upon, but should work
# for now. See the TODO in :func:`constraint_grouping
Expand Down
12 changes: 10 additions & 2 deletions src/oemof/solph/buses/_bus.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,20 @@ class Bus(Node):
"""

def __init__(self, label=None, *, inputs=None, outputs=None, balanced=True, custom_properties=None):
def __init__(
self,
label=None,
*,
inputs=None,
outputs=None,
balanced=True,
custom_properties=None,
):
super().__init__(
label,
inputs=inputs,
outputs=outputs,
custom_properties=custom_properties
custom_properties=custom_properties,
)
self.balanced = balanced

Expand Down
4 changes: 3 additions & 1 deletion src/oemof/solph/components/experimental/_generic_caes.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,9 @@ class GenericCAES(Node):
"""

def __init__(
self,label, *,
self,
label,
*,
electrical_input,
fuel_input,
electrical_output,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,23 @@ class PiecewiseLinearConverter(Node):
PiecewiseLinearConverter'>
"""

def __init__(self, label, *, inputs, outputs, conversion_function, in_breakpoints, pw_repn, custom_properties=None):
super().__init__(label, inputs=inputs, outputs=outputs, custom_properties=custom_properties)
def __init__(
self,
label,
*,
inputs,
outputs,
conversion_function,
in_breakpoints,
pw_repn,
custom_properties=None,
):
super().__init__(
label,
inputs=inputs,
outputs=outputs,
custom_properties=custom_properties,
)

self.in_breakpoints = list(in_breakpoints)
self.conversion_function = conversion_function
Expand Down
28 changes: 7 additions & 21 deletions tests/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,15 +107,9 @@ def test_multi_period_default_discount_rate():
def test_cellular_structure_detection():
"""Test flag creation if list is passed as energysystem to model"""
timeindex = pd.date_range(start="2020-01-01", periods=1, freq="H")
es = solph.EnergySystem(
timeindex=timeindex, infer_last_interval=True
)
ec_1 = solph.EnergySystem(
timeindex=timeindex, infer_last_interval=True
)
ec_2 = solph.EnergySystem(
timeindex=timeindex, infer_last_interval=True
)
es = solph.EnergySystem(timeindex=timeindex, infer_last_interval=True)
ec_1 = solph.EnergySystem(timeindex=timeindex, infer_last_interval=True)
ec_2 = solph.EnergySystem(timeindex=timeindex, infer_last_interval=True)
m = solph.Model(energysystem=[es, ec_1, ec_2])
assert m.is_cellular

Expand All @@ -126,12 +120,8 @@ def test_sub_cell_node_consideration():
energysystems.
"""
timeindex = pd.date_range(start="2020-01-01", periods=1, freq="H")
es = solph.EnergySystem(
timeindex=timeindex, infer_last_interval=True
)
ec_1 = solph.EnergySystem(
timeindex=timeindex, infer_last_interval=True
)
es = solph.EnergySystem(timeindex=timeindex, infer_last_interval=True)
ec_1 = solph.EnergySystem(timeindex=timeindex, infer_last_interval=True)
bus_es = solph.buses.Bus(label="bus_es")
bus_ec_1 = solph.buses.Bus(label="bus_ec_1")
es.add(bus_es)
Expand All @@ -146,12 +136,8 @@ def test_sub_cell_flow_consideration():
energysystems.
"""
timeindex = pd.date_range(start="2020-01-01", periods=1, freq="H")
es = solph.EnergySystem(
timeindex=timeindex, infer_last_interval=True
)
ec_1 = solph.EnergySystem(
timeindex=timeindex, infer_last_interval=True
)
es = solph.EnergySystem(timeindex=timeindex, infer_last_interval=True)
ec_1 = solph.EnergySystem(timeindex=timeindex, infer_last_interval=True)
bus_es = solph.buses.Bus(label="bus_es")
bus_ec_1 = solph.buses.Bus(label="bus_ec_1")
es.add(bus_es)
Expand Down

0 comments on commit 213b164

Please sign in to comment.