File tree Expand file tree Collapse file tree 3 files changed +6
-11
lines changed
RATapi/examples/normal_reflectivity Expand file tree Collapse file tree 3 files changed +6
-11
lines changed Original file line number Diff line number Diff line change 1-
21name : Run Unit Tests
32
43on :
Original file line number Diff line number Diff line change @@ -127,13 +127,5 @@ def DSPC_custom_layers():
127127
128128
129129if __name__ == "__main__" :
130- import RATapi
131-
132- RATapi .wrappers .get_matlab_engine ().editFile ((pathlib .Path (__file__ ).parent / "customBilayerDSPC.m" ).as_posix ())
133-
134- import time
135-
136- time .sleep (20 )
137130 problem , results = DSPC_custom_layers ()
138-
139131 RAT .plotting .plot_ref_sld (problem , results , True )
Original file line number Diff line number Diff line change @@ -143,6 +143,7 @@ class MatlabLoader
143143
144144 void close () {
145145 if (matlabPtr) {
146+ engEvalString (matlabPtr, " closeNoPrompt(matlab.desktop.editor.getAll);" );
146147 engEvalString (matlabPtr, " fclose all" );
147148 engEvalString (matlabPtr, " clear all" );
148149 engClose (matlabPtr);
@@ -193,6 +194,7 @@ class MatlabEngine
193194 void editFile (std::string path)
194195 {
195196 loader->open ();
197+ loader->engEvalString (loader->matlabPtr , " dbclear all" );
196198 loader->engEvalString (loader->matlabPtr , (" edit " + path).c_str ());
197199 };
198200
@@ -212,8 +214,10 @@ class MatlabEngine
212214 if (nOutput != expOutputCount)
213215 {
214216 throw std::runtime_error (" The custom function " + functionName + " is expected to have " +
215- std::to_string (expOutputCount) + " output but has " + std::to_string (nOutput) + " instead." );
216- }
217+ std::to_string (expOutputCount) + " output but has " + std::to_string (nOutput) + " instead." );
218+ }
219+ loader->engEvalString (loader->matlabPtr , " closeNoPrompt(matlab.desktop.editor.getAll);" );
220+ loader->engEvalString (loader->matlabPtr , " dbclear all" );
217221 funChanged = false ;
218222 }
219223 }
You can’t perform that action at this time.
0 commit comments