OpenModelica / OMSimulator

The OpenModelica FMI & SSP-based co-simulation environment.
Other
70 stars 50 forks source link

Python object-oriented API lacks Model.stepUntil() #1126

Closed bilderbuchi closed 2 years ago

bilderbuchi commented 2 years ago

Description

According to the docs, OMSimulatorPython offers also an object-oriented API. This is great because it feels a little more pythonic to use.

The methods in the Model class has simulation control methods that mirror these, with the exception of stepUntil(stopTime), which apparently has been overlooked.

Steps to reproduce the behavior

Follow the Python OO API example slightly below the link above, only instead of model.simulate(), use model.stepUntil(0.1), which should be equivalent. Instead, you encounter AttributeError: 'Model' object has no attribute 'stepUntil'

Expected behavior

Simulation runs until time 0.1.

NB: I know about the workaround of falling back to the other kind of API, but this mixes APIs which I don't consider a good practice. (oms.OMSimulator().stepUntil('model', 0.1))

Version and OS

lochel commented 2 years ago

This is fixed and there is now a new pypi package with version number 2.1.1.post146 available.

bilderbuchi commented 2 years ago

Wow, thanks for the quick fix!