FMIImport
During rework of the last pull request, I noted one of the TODO items:
https://github.com/OpenModelica/OMPython/blob/8a50b5f2d86884a50366fbc99f1180e1813decb6/tests/test_FMIImport.py#L35
Is this really needed for any FMU to import? Are there other possibilities?
I do expect that such a functionality should be possible using only standard Modelica, or?
This was added by you in #351
I suppose it should work without it. You can make a PR and see if the test pass.
This was added by you in #351
I suppose it should work without it. You can make a PR and see if the test pass.
I know that I added it - at that time I did not ask why it is not working - however, it is still failing; see the checks of my test branch at: https://github.com/syntron/OMPython/actions/runs/19550820822/job/55981548974
Error message:
FAILED 😰 tests/test_FMIImport.py::test_FMIImport - OMPython.ModelicaSystem.ModelicaSystemError: Error executing 'buildModel(M_me_FMU, variableFilter=".*")': OMC error occurred for 'sendExpression(buildModel(M_me_FMU, variableFilter=".*"), True):
00: [translation:error:618] [/tmp/cde47604-2523-4ebd-81ee-cddb62bce9b5/M_me_FMU.mo:false:59:7:59:37] Operator reinit may not be used in an algorithm section (use translation flag --allowNonStandardModelica=reinitInAlgorithms to ignore).
The generated Modelica code from FMU uses reinit inside algorithm section which is not allowed anymore. So in order to run this one need to use --allowNonStandardModelica=reinitInAlgorithms.
I guess this won't fix since we use OMSimulator now for importing FMUs. The importFMU API is kind of depreciated and there are no future plans for it.
I guess this won't fix since we use OMSimulator now for importing FMUs. The
importFMUAPI is kind of depreciated and there are no future plans for it.
If FMU import in OpenModelica is depreciated what would be the recommended way to load an FMU and extend it by additional code using OpenModelica? As I read the description of OMSimulator is mainly for simulating an FMU; not for the extending part ...
see also https://github.com/OpenModelica/OpenModelica/pull/10974 as reference about the status of FMI import
See also https://github.com/OpenModelica/OpenModelica/issues/5345
I have no idea if we are going to fix FMI import in future. But for now in order to make it work one need to use --allowNonStandardModelica=reinitInAlgorithms.
I have no idea if we are going to fix FMI import in future. But for now in order to make it work one need to use
--allowNonStandardModelica=reinitInAlgorithms.
That's a job for MAP-Lang/MAP-Lib. We're working on it.