Skip to content

Conversion guide to upgrade to OMPython 4 #373

Description

@AnHeuermann

Description

Is there a write up of the main breaking changes in OMPython v4.0.0?

While trying to update OMPython in https://github.com/OpenModelica/OpenModelicaLibraryTesting I noticed some breaking changes. It would be nice if there was some place in the documentation telling users how to upgrade.

Breaking changes I noticed:

  • Class OMCSessionZMQ no longer accepts Docker arguments --> I found a new class OMCProcessDocker which does and used that one.
  • Module pyparsing is no longer exported.
  • omc.sendExpression('exit') no longer works --> omc.sendExpression('quit()') or simply let the class destruction handle it.

Are there more mayor changes?

Activity

  1. syntron commented on Nov 13, 2025

    @syntron
    Contributor

    @AnHeuermann Thanks for your work an this; below my comments; see also issue #372 and #374

    • OMCSessionZMQ was splitted into several parts:
      • OMCSessionZMQ => handling of interactions with OMC
      • OMCProcess* => responsible for the connection to the OMC process; local, port, docker and WSL possible
      • OMCSesionCMD => OMC API, to be removed (see Remove the OMC API functions #276)
      • => using this structure and the other changes ModelicaSystem can be used with OMC local, via docker or via WSL
    • why would you need pyparsing directly? if needed it should be imported
    • I'm not aware of any change regarding omc.sendExpression('exit') - was this working before? I did not found any code handling this in v3.6.0

    other (breaking?) changes:

    • rework of file structure - should not be visible to the user
    • updated handling of linearisation; see LinearizationResult - should be compatible
    • use of ModelicaSystemCmd - should also not be directly visible to the user
    • simargs for ModelicSystem.simulation() - simflags depreciated

    in v4.1.0:

    • update of set*() functions - use a dictionary instead of string based definition; old version still working but depreciated
    • use of OMCPath - compatibility layer for Python < 3.12; limited functionality
    • update ModelicaSystem interface - split class initialisation and model definition (this will fix convertFmo2Mo())

    planned for v4.1.0:

    • finish fix for convertFmo2Mo()
    • rename variables - breaking change (in my v4.1.0-test branch; not available as PR for now)

    future (v5.0.0):

    feel free to ask if you need more information

  2. AnHeuermann commented on Nov 14, 2025

    @AnHeuermann
    MemberAuthor

    why would you need pyparsing directly? if needed it should be imported

    Yes, that is the better way and how I changed it. It was used to catch some specific parsing error.

  3. adeas31 commented on Oct 1, 2026

    @adeas31
    Member
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions