diff --git a/test/test_ac_dc_lopf.py b/test/test_ac_dc_lopf.py index bfac499f3..21fc9013b 100644 --- a/test/test_ac_dc_lopf.py +++ b/test/test_ac_dc_lopf.py @@ -22,14 +22,13 @@ def test_lopf(): + csv_folder_name = os.path.join(os.path.dirname(__file__), "../examples/ac-dc-meshed/ac-dc-data") - csv_folder_name = "../examples/ac-dc-meshed/ac-dc-data" - - network = pypsa.Network(csv_folder_name=csv_folder_name) + network = pypsa.Network(csv_folder_name) results_folder_name = os.path.join(csv_folder_name,"results-lopf") - network_r = pypsa.Network(csv_folder_name=results_folder_name) + network_r = pypsa.Network(results_folder_name) #test results were generated with GLPK; solution should be unique, diff --git a/test/test_ac_dc_lpf.py b/test/test_ac_dc_lpf.py index df7aaa62c..d3774876f 100644 --- a/test/test_ac_dc_lpf.py +++ b/test/test_ac_dc_lpf.py @@ -21,15 +21,13 @@ def test_lpf(): + csv_folder_name = os.path.join(os.path.dirname(__file__), "../examples/ac-dc-meshed/ac-dc-data") + network = pypsa.Network(csv_folder_name) - csv_folder_name = "../examples/ac-dc-meshed/ac-dc-data" + results_folder_name = os.path.join(csv_folder_name, "results-lpf") - network = pypsa.Network(csv_folder_name=csv_folder_name) - - results_folder_name = os.path.join(csv_folder_name,"results-lpf") - - network_r = pypsa.Network(csv_folder_name=results_folder_name) + network_r = pypsa.Network(results_folder_name) for snapshot in network.snapshots[:2]: network.lpf(snapshot) diff --git a/test/test_opf_storage.py b/test/test_opf_storage.py index 265bd2266..62a21df35 100644 --- a/test/test_opf_storage.py +++ b/test/test_opf_storage.py @@ -22,9 +22,9 @@ def test_opf(): - csv_folder_name = "../examples/opf-storage-hvdc/opf-storage-data" + csv_folder_name = os.path.join(os.path.dirname(__file__), "../examples/opf-storage-hvdc/opf-storage-data") - network = pypsa.Network(csv_folder_name=csv_folder_name) + network = pypsa.Network(csv_folder_name) #test results were generated with GLPK and other solvers may differ solver_name = "glpk" diff --git a/test/test_sclopf_scigrid.py b/test/test_sclopf_scigrid.py index e68b5fd97..ae700ed1b 100644 --- a/test/test_sclopf_scigrid.py +++ b/test/test_sclopf_scigrid.py @@ -1,17 +1,14 @@ from __future__ import print_function, division from __future__ import absolute_import -import pypsa - +import os import numpy as np - +import pypsa def test_sclopf(): + csv_folder_name = os.path.join(os.path.dirname(__file__), "../examples/scigrid-de/scigrid-with-load-gen-trafos/") - - csv_folder_name = "../examples/scigrid-de/scigrid-with-load-gen-trafos/" - - network = pypsa.Network(csv_folder_name=csv_folder_name) + network = pypsa.Network(csv_folder_name) #test results were generated with GLPK and other solvers may differ solver_name = "cbc"