@@ -38,13 +38,13 @@ def param_doe() -> dict[str, list]:
3838 return param
3939
4040
41- def test_ModelicaSystemDoE (tmp_path , model_doe , param_doe ):
42- tmpdir = tmp_path / 'DoE'
43- tmpdir .mkdir (exist_ok = True )
41+ def test_ModelicaSystemDoE (tmp_path , model_doe , param_doe , om ):
42+ # tmpdir = tmp_path / 'DoE'
43+ # tmpdir.mkdir(exist_ok=True)
4444
4545 # om = OMPython.OMCSessionZMQ()
46- omcp = OMPython .OMCProcessDocker (docker = "openmodelica/openmodelica:v1.25.0-minimal" )
47- om = OMPython .OMCSessionZMQ (omc_process = omcp )
46+ # omcp = OMPython.OMCProcessDocker(docker="openmodelica/openmodelica:v1.25.0-minimal")
47+ # om = OMPython.OMCSessionZMQ(omc_process=omcp)
4848
4949 model_path = om .omcpath_tempdir ()
5050 model_file = model_path / 'M.mo'
@@ -64,14 +64,14 @@ def test_ModelicaSystemDoE(tmp_path, model_doe, param_doe):
6464 doe_count = doe_mod .prepare ()
6565 assert doe_count == 16
6666
67- doe_dict = doe_mod .get_doe ()
67+ doe_dict = doe_mod .get_doe_definition ()
6868 assert isinstance (doe_dict , dict )
6969 assert len (doe_dict .keys ()) == 16
7070
7171 doe_status = doe_mod .simulate ()
7272 assert doe_status is True
7373
74- doe_sol = doe_mod .get_solutions ()
74+ doe_sol = doe_mod .get_doe_solutions ()
7575
7676 for resultfilename in doe_dict :
7777 row = doe_dict [resultfilename ]
@@ -93,29 +93,33 @@ def test_ModelicaSystemDoE(tmp_path, model_doe, param_doe):
9393
9494 for var in var_dict :
9595 assert var in sol ['data' ]
96+ # logger.info(f"{resultfilename}:{var} {sol['data'][var][-1]} <> {var_dict[var]}")
9697 assert np .isclose (sol ['data' ][var ][- 1 ], var_dict [var ])
9798
99+ doe_def = doe_mod .get_doe_definition ()
100+ doe_cmd = doe_mod .get_doe_command ()
101+
102+ # logger.warning(doe_def)
103+ # logger.warning(doe_cmd)
104+ # logger.warning(doe_sol)
105+
98106
99107if __name__ == "__main__" :
100108 # om = OMPython.OMCSessionZMQ()
101109 omcp = OMPython .OMCProcessDocker (docker = "openmodelica/openmodelica:v1.25.0-minimal" )
102110 om = OMPython .OMCSessionZMQ (omc_process = omcp )
103111
104- tempdir_local = pathlib .Path ('.' ) / 'DoE'
105- tempdir_local = tempdir_local .resolve ().absolute ()
106- tempdir_local .mkdir (exist_ok = True )
107112 tempdir_omcpath = om .omcpath_tempdir ()
108113
109- model_file_local = model_doe (tempdir_local )
110- model_file_omcpath = tempdir_omcpath / 'M.mo'
111- model_file_omcpath .write_text (model_file_local .read_text ())
114+ model_file_local = model_doe (tempdir_omcpath )
112115
113116 param = param_doe ()
114117
115118 test_ModelicaSystemDoE (
116119 tmp_path = tempdir_omcpath ,
117- model_doe = model_file_omcpath ,
120+ model_doe = model_file_local ,
118121 param_doe = param ,
122+ om = om ,
119123 )
120124
121125 print ("DONE" )
0 commit comments