Skip to content

Make varying period lenghts possible #955

Make varying period lenghts possible

Make varying period lenghts possible #955

GitHub Actions / Black failed Jul 19, 2023 in 0s

10 errors

Black found 10 errors

Annotations

Check failure on line 76 in /home/runner/work/oemof-solph/oemof-solph/examples/storage_investment/v2_invest_optimize_only_gas_and_storage.py

See this annotation in the file changed.

@github-actions github-actions / Black

/home/runner/work/oemof-solph/oemof-solph/examples/storage_investment/v2_invest_optimize_only_gas_and_storage.py#L66-L76

 import os
 import pprint as pp
 import warnings
 
 import pandas as pd
+
 # Default logger of oemof
 from oemof.tools import economics
 from oemof.tools import logger
 
 from oemof import solph

Check failure on line 76 in /home/runner/work/oemof-solph/oemof-solph/examples/storage_investment/v1_invest_optimize_all_technologies.py

See this annotation in the file changed.

@github-actions github-actions / Black

/home/runner/work/oemof-solph/oemof-solph/examples/storage_investment/v1_invest_optimize_all_technologies.py#L66-L76

 import os
 import pprint as pp
 import warnings
 
 import pandas as pd
+
 # Default logger of oemof
 from oemof.tools import economics
 from oemof.tools import logger
 
 from oemof import solph

Check failure on line 75 in /home/runner/work/oemof-solph/oemof-solph/examples/storage_investment/v3_invest_optimize_only_storage_with_fossil_share.py

See this annotation in the file changed.

@github-actions github-actions / Black

/home/runner/work/oemof-solph/oemof-solph/examples/storage_investment/v3_invest_optimize_only_storage_with_fossil_share.py#L65-L75

 import os
 import pprint as pp
 import warnings
 
 import pandas as pd
+
 # Default logger of oemof
 from oemof.tools import economics
 from oemof.tools import logger
 
 from oemof import solph

Check failure on line 72 in /home/runner/work/oemof-solph/oemof-solph/examples/storage_investment/v4_invest_optimize_all_technologies_with_fossil_share.py

See this annotation in the file changed.

@github-actions github-actions / Black

/home/runner/work/oemof-solph/oemof-solph/examples/storage_investment/v4_invest_optimize_all_technologies_with_fossil_share.py#L62-L72

 import os
 import pprint as pp
 import warnings
 
 import pandas as pd
+
 # Default logger of oemof
 from oemof.tools import economics
 from oemof.tools import logger
 
 from oemof import solph

Check failure on line 34 in /home/runner/work/oemof-solph/oemof-solph/src/oemof/solph/_groupings.py

See this annotation in the file changed.

@github-actions github-actions / Black

/home/runner/work/oemof-solph/oemof-solph/src/oemof/solph/_groupings.py#L22-L34

 SPDX-License-Identifier: MIT
 """
 
 from oemof.network import groupings as groupings
 
-from oemof.solph.flows._invest_non_convex_flow_block import \
-    InvestNonConvexFlowBlock
+from oemof.solph.flows._invest_non_convex_flow_block import (
+    InvestNonConvexFlowBlock,
+)
 from oemof.solph.flows._investment_flow_block import InvestmentFlowBlock
 from oemof.solph.flows._non_convex_flow_block import NonConvexFlowBlock
 from oemof.solph.flows._simple_flow_block import SimpleFlowBlock
 
 

Check failure on line 36 in /home/runner/work/oemof-solph/oemof-solph/src/oemof/solph/_models.py

See this annotation in the file changed.

@github-actions github-actions / Black

/home/runner/work/oemof-solph/oemof-solph/src/oemof/solph/_models.py#L24-L36

 from pyomo.opt import SolverFactory
 
 from oemof.solph import processing
 from oemof.solph.buses._bus import BusBlock
 from oemof.solph.components._transformer import TransformerBlock
-from oemof.solph.flows._invest_non_convex_flow_block import \
-    InvestNonConvexFlowBlock
+from oemof.solph.flows._invest_non_convex_flow_block import (
+    InvestNonConvexFlowBlock,
+)
 from oemof.solph.flows._investment_flow_block import InvestmentFlowBlock
 from oemof.solph.flows._non_convex_flow_block import NonConvexFlowBlock
 from oemof.solph.flows._simple_flow_block import SimpleFlowBlock
 
 

Check failure on line 169 in /home/runner/work/oemof-solph/oemof-solph/tests/test_scripts/test_solph/test_multi_period_model/test_multi_period_varying_period_length.py

See this annotation in the file changed.

@github-actions github-actions / Black

/home/runner/work/oemof-solph/oemof-solph/tests/test_scripts/test_solph/test_multi_period_model/test_multi_period_varying_period_length.py#L158-L169

     om = solph.Model(es)
     # om.write("file.lp", io_options={"symbolic_solver_labels": True})
     if lp:
         return om
     else:
-
         # Solve the optimization problem
         om.solve(solver="cbc")
 
         # Get the results
         results = om.results()

Check failure on line 181 in /home/runner/work/oemof-solph/oemof-solph/tests/test_scripts/test_solph/test_multi_period_model/test_multi_period_varying_period_length.py

See this annotation in the file changed.

@github-actions github-actions / Black

/home/runner/work/oemof-solph/oemof-solph/tests/test_scripts/test_solph/test_multi_period_model/test_multi_period_varying_period_length.py#L170-L181

         # Convert the results into a more readable format
         result_views = solph.views.convert_keys_to_strings(results)
 
         # Investment results for
         # storage capacity investment
-        df_storage_invest_mwh = result_views[("storage", "None")]["period_scalars"]
+        df_storage_invest_mwh = result_views[("storage", "None")][
+            "period_scalars"
+        ]
         # capacity investment
         df_storage_invest_mw = result_views[("storage", "electricity")][
             "period_scalars"
         ]
 

Check failure on line 2016 in /home/runner/work/oemof-solph/oemof-solph/tests/constraint_tests.py

See this annotation in the file changed.

@github-actions github-actions / Black

/home/runner/work/oemof-solph/oemof-solph/tests/constraint_tests.py#L2004-L2016

 
         df_profiles = pd.DataFrame(
             {
                 "demand": [7e-05] * len(timeindex),
                 "pv-profile": ([0.0] * 8 + [0.1] * 4) * len(periods),
-                "wind-profile": ([0.1] * 5 + [0.2] * 4 + [0.1] * 3) * len(
-                    periods),
+                "wind-profile": ([0.1] * 5 + [0.2] * 4 + [0.1] * 3)
+                * len(periods),
             },
             index=timeindex,
         )
 
         # df_profiles = pd.read_csv("profiles.csv", index_col=0, parse_dates=True)

Check failure on line 2071 in /home/runner/work/oemof-solph/oemof-solph/tests/constraint_tests.py

See this annotation in the file changed.

@github-actions github-actions / Black

/home/runner/work/oemof-solph/oemof-solph/tests/constraint_tests.py#L2059-L2071

             ),
         )
 
         demand = solph.components.Sink(
             label="demand",
-            inputs={bel: solph.Flow(fix=df_profiles["demand"],
-                                    nominal_value=1e5)},
+            inputs={
+                bel: solph.Flow(fix=df_profiles["demand"], nominal_value=1e5)
+            },
         )
 
         pv = solph.components.Source(
             label="pv",
             outputs={