Skip to content

Integrate TSAM mode in oemof.solph #407

Integrate TSAM mode in oemof.solph

Integrate TSAM mode in oemof.solph #407

GitHub Actions / Black failed Oct 31, 2023 in 0s

3 errors

Black found 3 errors

Annotations

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

See this annotation in the file changed.

@github-actions github-actions / Black

/home/runner/work/oemof-solph/oemof-solph/examples/storage_investment/v6_invest_optimize_all_technologies_using_mp_and_tsam.py#L304-L315

     # initialise the operational model
     om = solph.Model(energysystem)
 
     # if tee_switch is true solver messages will be displayed
     logging.info("Solve the optimization problem")
-    om.write('my_model.lp', io_options={'symbolic_solver_labels': True})
+    om.write("my_model.lp", io_options={"symbolic_solver_labels": True})
     om.solve(solver="cbc", solve_kwargs={"tee": True})
 
     ##########################################################################
     # Check and plot the results
     ##########################################################################

Check failure on line 156 in /home/runner/work/oemof-solph/oemof-solph/tests/test_scripts/test_solph/test_tsam/test_storage_tsam_integration.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_tsam/test_storage_tsam_integration.py#L145-L156

 last_output = (100 * 1 / 0.8) / 0.99
 init_soc = (first_input - last_output) / (1 / 0.99 + 0.99)
 
 
 def test_storage_input():
-    assert flows["electricity-storage"][0] == pytest.approx((first_input - 0.99 * init_soc) / 0.9)
+    assert flows["electricity-storage"][0] == pytest.approx(
+        (first_input - 0.99 * init_soc) / 0.9
+    )
     assert flows["electricity-storage"][1] == 0
     assert flows["electricity-storage"][2] == 0
     assert flows["electricity-storage"][3] == 0
     assert flows["electricity-storage"][4] == 0
     assert flows["electricity-storage"][5] == 0

Check failure on line 163 in /home/runner/work/oemof-solph/oemof-solph/tests/test_scripts/test_solph/test_tsam/test_storage_invest_tsam_integration.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_tsam/test_storage_invest_tsam_integration.py#L148-L163

 init_soc = 0
 
 
 def test_storage_investment():
     """Make sure that max SOC investment equals max load"""
-    assert results[storage, None]["period_scalars"]["invest"].iloc[0] == pytest.approx(first_input)
+    assert results[storage, None]["period_scalars"]["invest"].iloc[
+        0
+    ] == pytest.approx(first_input)
 
 
 def test_storage_input():
-    assert flows["electricity-storage"][0] == pytest.approx((first_input - 0.99 * init_soc) / 0.9)
+    assert flows["electricity-storage"][0] == pytest.approx(
+        (first_input - 0.99 * init_soc) / 0.9
+    )
     assert flows["electricity-storage"][1] == 0
     assert flows["electricity-storage"][2] == 0
     assert flows["electricity-storage"][3] == 0
     assert flows["electricity-storage"][4] == 0
     assert flows["electricity-storage"][5] == 0