Conversion guide to upgrade to OMPython 4
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
OMCSessionZMQno longer accepts Docker arguments --> I found a new classOMCProcessDockerwhich does and used that one. - Module
pyparsingis 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?
@AnHeuermann Thanks for your work an this; below my comments; see also issue #372 and #374
-
OMCSessionZMQwas 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 #276) - => using this structure and the other changes ModelicaSystem can be used with OMC local, via docker or via WSL
-
- why would you need
pyparsingdirectly? 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
ModelicaSysteminterface - split class initialisation and model definition (this will fixconvertFmo2Mo())
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):
- remove support of Python < 3.12 (
OMCPath) - PR #346 -
set*()function - suport only *kwargs - PR #347 - remove simflags for simulate() - PR #308
feel free to ask if you need more information
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.