Skip to content

Remove the OMC API functions #276

Open
Open

Description

@adeas31

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.

Activity

  1. added this to the milestone on Apr 30, 2025
  2. added theissue type on Apr 30, 2025
  3. syntron commented on May 3, 2025

    @syntron
    Contributor

    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() - ???
  4. casella commented on Jun 2, 2025

    @casella

    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?

  5. modified the milestones: , on Jun 17, 2025
  6. adeas31 commented on Jun 17, 2025

    @adeas31
    MemberAuthor

    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.

  7. syntron commented on Nov 16, 2025

    @syntron
    Contributor

    would this project a source for the OMC API? https://github.com/ijknabla/OpenModelicaCompilerForPython

    I'm quite unsure about the relation to OMPython ...

  8. adeas31 commented on Nov 17, 2025

    @adeas31
    MemberAuthor

    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

  9. casella commented on Nov 17, 2025

    @casella

    Interesting. I was also not aware of that.

  10. syntron commented on Nov 17, 2025

    @syntron
    Contributor

    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 ...

  11. modified the milestones: , 5.0.0 on Dec 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions