5
5
from check_preconditions import check_preconditions
6
6
import mpi4py .rc
7
7
mpi4py .rc .threads = False
8
- from mpi4py import MPI # noqa
9
- import exago # noqa
8
+ from mpi4py import MPI
9
+ import exago
10
10
11
11
check_preconditions ()
12
12
13
13
exago_ignore = - 1000000
14
14
15
- ''' cannot run just creating tcopflow object bc opflow sub objects
16
- won't be allocated (done in TCOPFLOWSetUp) so destructor seg faults
17
- def test_creating_tcopflow():
18
- tcopf = exago.TCOPFLOW()
19
- '''
20
15
21
16
22
17
def run_tcopflow (solver ):
@@ -27,10 +22,7 @@ def run_tcopflow(solver):
27
22
tcopf .set_network_data (os .path .join (
28
23
path , 'share' , 'exago' , 'datafiles' , 'case9' , 'case9mod_gen3_wind.m' ))
29
24
tcopf .set_solver (solver )
30
- # set_time_step_and_duration
31
- # set_load_profiles
32
- # set_wind_gen_profiles
33
-
25
+
34
26
tcopf .setup ()
35
27
tcopf .solve ()
36
28
@@ -42,47 +34,8 @@ def run_tcopflow(solver):
42
34
n = tcopf .get_num_iterations ()
43
35
assert isinstance (n , int )
44
36
45
- # get_solution
46
- # print_solution
47
-
48
- ''' oname = os.path.join(tempfile.gettempdir(), "tcopflow_test_solution.csv")
49
- tcopf.save_solution(0, exago.OutputFormat.CSV, oname)
50
- assert os.path.exists(oname)
51
- os.unlink(oname)
52
-
53
- oname = os.path.join(tempfile.gettempdir(), "tcopflow_test_solution.m")
54
- tcopf.save_solution(0, exago.OutputFormat.MATPOWER, oname)
55
- assert os.path.exists(oname)
56
- os.unlink(oname)
57
-
58
- oname = os.path.join(tempfile.gettempdir(), "tcopflow_test_solution_dir")
59
- tcopf.save_solution_all(exago.OutputFormat.MATPOWER, oname)
60
- assert os.path.exists(oname)
61
- shutil.rmtree(oname)'''
62
-
63
37
64
- # From sopflow_multicontingency.toml:
65
- # description =
66
- # 'datafiles/case9/case9mod_gen3_wind.m IPOPT 3scen contingencies SOPFLOW'
67
38
@pytest .mark .nocomm
68
39
@pytest .mark .MPI
69
40
def test_tcopflow_1 ():
70
41
run_tcopflow ('IPOPT' )
71
-
72
-
73
- ''' example
74
- @pytest.mark.nocomm
75
- @pytest.mark.MPI
76
- def test_set_model_and_solver():
77
- <put three single quotes here> Testing setting model <put three single quotes here>
78
- opf = exago.OPFLOW()
79
- opf.set_solver("HIOP")
80
- solver = opf.get_solver()
81
- assert solver == "HIOP"
82
- opf.set_model("POWER_BALANCE_HIOP")
83
- model = opf.get_model()
84
- assert model == "POWER_BALANCE_HIOP"
85
- path = exago.prefix()
86
- opf.read_mat_power_data(os.path.join(
87
- path, 'share', 'exago', 'datafiles', 'case9', 'case9mod.m'))
88
- '''
0 commit comments