Remove the OMC API functions
Write now we have created wrapper functions for each OMC API. It is very difficult to keep track of API changes. OMPython is not directly linked with OMC so it is not possible to generate these wrapper functions automatically.
I suggest we remove these wrapper functions and clean up the code. The user can still call OMC API using sendExpression.
PR #282 prepares this; it removes all dependencies on OMCSessionBase - currently it keeps the code alive as OMCSessionCmd but if needed, this part can be removed
I have no feelings regarding this as I do not use the interface provided here ...
The main point to keep it would be that besides 4 function it is quite simple code now. The functions are:
- getClassComment() - pyparsing.ParseException should be handled in sendExpression()
- getParameterNames() - additional check for KeyError needed?
- getParameterValue() - pyparsing.ParseException should be handled in sendExpression()
- getNthComponentModification() - ???
Write now we have created wrapper functions for each OMC API. It is very difficult to keep track of API changes. OMPython is not directly linked with OMC so it is not possible to generate these wrapper functions automatically.
I suggest we remove these wrapper functions and clean up the code. The user can still call OMC API using
sendExpression.
@adeas31 is this backwards compatible? What happens to existing code using OMPython?
Write now we have created wrapper functions for each OMC API. It is very difficult to keep track of API changes. OMPython is not directly linked with OMC so it is not possible to generate these wrapper functions automatically. I suggest we remove these wrapper functions and clean up the code. The user can still call OMC API using
sendExpression.@adeas31 is this backwards compatible? What happens to existing code using OMPython?
It will not be backwards compatible. Any script using these functions will not work.
At some time we need to take that jump. OMPython depends on OMC but is not directly linked to it. So we have hard coded all the OMC API functions which means there is no way to know if OMPython is broken because of a change in OMC API.
would this project a source for the OMC API? https://github.com/ijknabla/OpenModelicaCompilerForPython
I'm quite unsure about the relation to OMPython ...
would this project a source for the OMC API? https://github.com/ijknabla/OpenModelicaCompilerForPython
No. This is not the source of OMC API. I have never seen this project before. OMC API is located here https://github.com/OpenModelica/OpenModelica/blob/master/OMCompiler/Compiler/FrontEnd/ModelicaBuiltin.mo
Interesting. I was also not aware of that.
There seems to be some conversion of the OMC API into a yaml file which then is used to create the matching Python code - this looks like a (semi?) automated way to (re)create the OMC API in Python ...