Skip to content

Commit 666b028

Browse files
Jaya MohanJaya Mohan
Jaya Mohan
authored and
Jaya Mohan
committed
clean tcopflow test file
1 parent 08060ca commit 666b028

File tree

1 file changed

+3
-50
lines changed

1 file changed

+3
-50
lines changed

tests/interfaces/python/test_5_tcopflow.py

+3-50
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,13 @@
55
from check_preconditions import check_preconditions
66
import mpi4py.rc
77
mpi4py.rc.threads = False
8-
from mpi4py import MPI # noqa
9-
import exago # noqa
8+
from mpi4py import MPI
9+
import exago
1010

1111
check_preconditions()
1212

1313
exago_ignore = -1000000
1414

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-
'''
2015

2116

2217
def run_tcopflow(solver):
@@ -27,10 +22,7 @@ def run_tcopflow(solver):
2722
tcopf.set_network_data(os.path.join(
2823
path, 'share', 'exago', 'datafiles', 'case9', 'case9mod_gen3_wind.m'))
2924
tcopf.set_solver(solver)
30-
# set_time_step_and_duration
31-
# set_load_profiles
32-
# set_wind_gen_profiles
33-
25+
3426
tcopf.setup()
3527
tcopf.solve()
3628

@@ -42,47 +34,8 @@ def run_tcopflow(solver):
4234
n = tcopf.get_num_iterations()
4335
assert isinstance(n, int)
4436

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-
6337

64-
# From sopflow_multicontingency.toml:
65-
# description =
66-
# 'datafiles/case9/case9mod_gen3_wind.m IPOPT 3scen contingencies SOPFLOW'
6738
@pytest.mark.nocomm
6839
@pytest.mark.MPI
6940
def test_tcopflow_1():
7041
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

Comments
 (0)