modelon-community / PyFMI

PyFMI is a package for loading and interacting with Functional Mock-Up Units (FMUs) both for Model Exchange and Co-Simulation, which are compiled dynamic models compliant with the Functional Mock-Up Interface (FMI)
http://jmodelica.org/pyfmi
GNU Lesser General Public License v3.0
160 stars 38 forks source link

Avoid fmi2_import_get_derivatives with NULL array #185

Closed jschueller closed 1 year ago

jschueller commented 1 year ago

Closes #184, similar fix as in #92

Do you know why _nContinuousStates is zero in ME mode ?

cc @modelonrobinandersson

modelonrobinandersson commented 1 year ago

Hi @jschueller I have been busy this week, my plan is to run some additional testing with this PR next week and hopefully I can accept and close this PR by then. Sorry for the delay.

jschueller commented 1 year ago

ok, I also added a CI script at #186 you can consider

modelonrobinandersson commented 1 year ago

@jschueller could you add a changelog? And then we can merge it

jschueller commented 1 year ago

done, could we have a new patch release after that ?

PeterMeisrimelModelon commented 1 year ago

Currently running the aforementioned tests. If there are no issues, I'll merge and make a new tag + release tomorrow

PeterMeisrimelModelon commented 1 year ago

Currently running the aforementioned tests. If there are no issues, I'll merge and make a new tag + release tomorrow

Detected some issues and currently investigating.

PeterMeisrimelModelon commented 1 year ago

Can you add a corresponding check and shortcut for FMUModelME1 as well? We'd want consistent behavior in both cases.

jschueller commented 1 year ago

I cannot try if this happens also on fmi1 atm because of an openmodelica bug: https://github.com/OpenModelica/OpenModelica/issues/10848 can we proceed with the fmi2 fix, and get back to fmi1 when this is fixed in openmodelica ?

PeterMeisrimelModelon commented 1 year ago

I added the corresponding fix for FMI1 in https://github.com/modelon-community/PyFMI/tree/dev-pm-deriv, currently running tests.

jschueller commented 1 year ago

great, should I drop my PR then ?

PeterMeisrimelModelon commented 1 year ago

Yes, can drop this one.

See https://github.com/modelon-community/PyFMI/pull/187

Please add any comments on the changes there.

jschueller commented 1 year ago

fine with me