Skip to content

Conversation

@AnHeuermann
Copy link
Member

@AnHeuermann AnHeuermann commented Nov 3, 2025

Issue

Fixes #243.

Purpose

  • OMPython 4.0 no longer provides this function

Changes

  • Remove FindBestOMCSession import
  • Don't install Python module juliacall in non-BaseModelica.jl test
  • Use OMCProcessDocker

@AnHeuermann AnHeuermann self-assigned this Nov 3, 2025
@AnHeuermann AnHeuermann changed the title Removing unused FindBestOMCSession Updating to OMPython 4.0 Nov 3, 2025
@AnHeuermann
Copy link
Member Author

AnHeuermann commented Nov 12, 2025

On my machine verification works, but in the CI it is broken.

My machine, nightly:
grafik

ubuntu-latest, nightly:
grafik

The other library MyOtherLibrary_1.0.0 does verify. Very strange.

@AnHeuermann AnHeuermann marked this pull request as draft November 12, 2025 14:25
@AnHeuermann
Copy link
Member Author

Running the sanity check inside a devcontainer with Ubuntu Noble and installed nightly omc I can reproduce the issue. Looks like simulation result files are missing only for MyLibrary_1.0.0

vscode ➜ /workspaces/OpenModelicaLibraryTesting (fixes-ompython-4) $ find . -name "*.mat"
./MyOtherLibrary_1.0.0_MyOtherLibrary.Blocks.Examples.PID_Controller/MyOtherLibrary_1.0.0_MyOtherLibrary.Blocks.Examples.PID_Controller_res.mat
./HelloWorld_res.mat

Re-running the simulation gives me the same. The simulation is successful, but no result file is generated.

$ ./MyLibrary_1.0.0_MyLibrary.Blocks.Examples.PID_Controller  -abortSlowSimulation -alarm=480 -lv LOG_STATS                
LOG_SUCCESS       | info    | The initialization finished successfully with 3 homotopy steps.
LOG_STATS         | info    | ### STATISTICS ###
|                 | |       | | timer
|                 | |       | | |    0.0020718s          reading init.xml
|                 | |       | | |    0.0001838s          reading info.xml
|                 | |       | | |     9.26e-05s [  1.9%] pre-initialization
|                 | |       | | |     8.14e-05s [  1.7%] initialization
|                 | |       | | |        8e-07s [  0.0%] steps
|                 | |       | | |    0.0009614s [ 20.1%] solver (excl. callbacks)
|                 | |       | | |            0s [  0.0%] creating output-file
|                 | |       | | |    0.0004292s [  9.0%] event-handling
|                 | |       | | |    0.0006577s [ 13.8%] overhead
|                 | |       | | |    0.0025565s [ 53.5%] simulation
|                 | |       | | |    0.0047796s [100.0%] total
|                 | |       | | events
|                 | |       | | |     5 state events
|                 | |       | | |     0 time events
|                 | |       | | solver: dassl
|                 | |       | | |   400 steps taken
|                 | |       | | |   537 calls of functionODE
|                 | |       | | |   116 evaluations of jacobian
|                 | |       | | |    18 error test failures
|                 | |       | | |     0 convergence test failures
|                 | |       | | | 0.0002015s time of jacobian evaluation
LOG_SUCCESS       | info    | The simulation finished successfully.

  - On the CI path to reference files is relative,
    but scripts need it to be absolute.
@AnHeuermann AnHeuermann marked this pull request as ready for review November 12, 2025 16:32
@AnHeuermann
Copy link
Member Author

This PR is now ready to be merged. But we should wait for a day without a lot of changes to see if any regressions are cause by the script failing or by changes in omc.

@AnHeuermann AnHeuermann merged commit 3aa8a07 into OpenModelica:master Nov 13, 2025
8 checks passed
@AnHeuermann AnHeuermann deleted the fixes-ompython-4 branch November 13, 2025 11:53
AnHeuermann added a commit to AnHeuermann/OpenModelicaLibraryTesting that referenced this pull request Nov 13, 2025

def omcAssert(omc, cmd, extra=""):
def omcAssert(omc: OMCSessionZMQ, cmd: str, extra: str = ""):
res = omc.sendExpression(cmd)
Copy link

@syntron syntron Nov 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

omc.SendExpression() will handle the checking of getErrorString() and pyparsing validation for you; please check agains OMCSessionException; see OMCSession.sendExpression()

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In that case we can simply remove omcAssert.

AnHeuermann added a commit to AnHeuermann/OpenModelicaLibraryTesting that referenced this pull request Nov 17, 2025
…lica#248

Revert update of OMPython

- Keep devcontainer
- Keep update to Markdown files

This reverts commit 342ed04.
AnHeuermann added a commit that referenced this pull request Nov 17, 2025
Revert update of OMPython

- Keep devcontainer
- Keep update to Markdown files

This reverts commit 342ed04.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update Python script to OMPython 4.0.0

2 participants