From da8f826692a0306e0af184602dca4f88073f0ec9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrik=20Sch=C3=B6nfeldt?= Date: Mon, 27 Nov 2023 14:41:59 +0100 Subject: [PATCH] Adhere to Black --- .../solph/flows/_non_convex_flow_block.py | 20 +++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/src/oemof/solph/flows/_non_convex_flow_block.py b/src/oemof/solph/flows/_non_convex_flow_block.py index 100f4ea91..1f5dbe96e 100644 --- a/src/oemof/solph/flows/_non_convex_flow_block.py +++ b/src/oemof/solph/flows/_non_convex_flow_block.py @@ -87,8 +87,12 @@ def _create_variables(self): self.status = Var(self.NONCONVEX_FLOWS, m.TIMESTEPS, within=Binary) for o, i in self.NONCONVEX_FLOWS: if m.flows[o, i].nonconvex.initial_status is not None: - for t in range(0, m.flows[o, i].nonconvex.first_flexible_timestep): - self.status[o, i, t] = m.flows[o, i].nonconvex.initial_status + for t in range( + 0, m.flows[o, i].nonconvex.first_flexible_timestep + ): + self.status[o, i, t] = m.flows[ + o, i + ].nonconvex.initial_status self.status[o, i, t].fix() # `status_nominal` is a parameter which represents the @@ -470,7 +474,11 @@ def min_downtime_rule(_, i, o, t): """ Rule definition for min-downtime constraints of non-convex flows. """ - if m.flows[i, o].nonconvex.first_flexible_timestep < t < m.TIMESTEPS.at(-1): + if ( + m.flows[i, o].nonconvex.first_flexible_timestep + < t + < m.TIMESTEPS.at(-1) + ): expr = 0 expr += ( self.status[i, o, t - 1] - self.status[i, o, t] @@ -516,7 +524,11 @@ def _min_uptime_rule(_, i, o, t): """ Rule definition for min-uptime constraints of non-convex flows. """ - if m.flows[i, o].nonconvex.first_flexible_timestep < t < m.TIMESTEPS.at(-1): + if ( + m.flows[i, o].nonconvex.first_flexible_timestep + < t + < m.TIMESTEPS.at(-1) + ): expr = 0 expr += ( self.status[i, o, t] - self.status[i, o, t - 1]