improve returned data if running a simulation (using the model executable)#398
improve returned data if running a simulation (using the model executable)#398syntron wants to merge 3 commits intoOpenModelica:masterfrom
Conversation
| cwd=cmd_run_data.cmd_cwd_local, | ||
| timeout=cmd_run_data.cmd_timeout, | ||
| check=True, | ||
| check=False, |
There was a problem hiding this comment.
Getting an exception on non-zero exit code was good. Exceptions for handling control flow in Python are totally fine, and obvious to the user, and hard to miss, I would keep that. (I did not realize that that's what's happening because I did not dig deep enough in the call hierarchy)
The additional logging is good, so I'd keep that too. 👍
There was a problem hiding this comment.
The exception on non-zero exit code has to be handled with care. There are possibilities that a result file is created (and usefull) even if the exit code is != 0. An exception here would prevent any processing of such data.
If I remeber correctly, an example is if the model is terminated via Modelica code.
There was a problem hiding this comment.
If I remeber correctly, an example is if the model is terminated via Modelica code.
You mean via terminate()? If yes a nonzero exit code would be strange, because this "successfully terminates the analysis which was carried out".
…table * use check=False => no CalledProcessError exception; possibility to handle the error code * error code needs to be checked (compare == 0) by the caller! * improve log messages; print returncode if it is != 0 with stdout
* ensure a message if logged if returncode != 0
* self.session().run_model_executable() will raise OMCSessionException!
see #108
[OMCSession] improve log messages for model simulation using OM executable
[ModelicaSystem] improve handling of model simulation