Improvements to behaviour of ModelicaSystem class
I think it would be useful to add these changes to OMPython:
1.) When calling getParameters() and if a parameter is a string that is not true or false and cannot be converted to a float, return the string value instead of throwing an error, since the parameter then probably is a string (e. g. a file path)
2.) When calling getSolutions() and no solution is present yet, the undefined function exit() is called, while I think sys.exit() should be called
I don't think it should exit the process almost regardless of what happens. Better to raise an error and possibly quit the OM connection if it's fatal.
Sent from BlueMail
On 25 May 2017, 16:24, at 16:24, "Adrian Bürger" [email protected] wrote:
I think it would be useful to add these changes to OMPython:
1.) When calling getParameters() and if a parameter is a string that is not true or false and cannot be converted to a float, return the string value instead of throwing an error, since the parameter then probably is a string (e. g. a file path)
2.) When calling getSolutions() and no solution is present yet, the undefined function exit() is called, while I think sys.exit() should be called
You can view, comment on, or merge this pull request online at:
https://github.com/OpenModelica/OMPython/pull/22
-- Commit Summary --
- If a parameter is a string that is not true or false and cannot be converted to a float, return the string value instead of throwing an error
- exit() is not defined, calling sys.exit() instead
-- File Changes --
M OMPython/init.py (7)
-- Patch Links --
https://github.com/OpenModelica/OMPython/pull/22.patch https://github.com/OpenModelica/OMPython/pull/22.diff
-- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/OpenModelica/OMPython/pull/22
@sjoelund Thanks for you remark, you are right, I changed it accordingly. I only used sys.exit() since I thought it was the function intended to be called with the previously undefined function exit().
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.