Skip to content

feat: basic FMI3 CS doStep implementation - #415

Merged
PeterMeisrimelModelon merged 5 commits into
masterfrom
dev-pm-480
Aug 11, 2026
Merged

feat: basic FMI3 CS doStep implementation#415
PeterMeisrimelModelon merged 5 commits into
masterfrom
dev-pm-480

Conversation

@PeterMeisrimelModelon

@PeterMeisrimelModelon PeterMeisrimelModelon commented Jul 10, 2026

Copy link
Copy Markdown
Collaborator

Not really re-viewable commit-by-commit.

Test re-structuring:

  1. Moved the relevant new fixtures for FMI3 CS testing to conftest.py and the relevant helper functions to the new utils.py.

Comments for the actual changes:

  1. My take of the FMI3 spec is that "terminate" is not formally included in the "earlyReturn", which I base on the https://fmi-standard.org/docs/3.0.2/#_basic_co_simulation in the specification. I.e., FMUs are allowed to return with terminateSimulation = True, even if instantiated with allowEarlyReturn=False
  2. terminate now being part of the do_step signature is a breaking change, so we need a new mechanism to handle this. I think the 3 possible ways are a class attribute (the current variant), a helper function that fulfills the same purpose as the attribute, or make do_step have multiple returns. Multiple returns might be most aligned with the underlying C-API behavior, but least consistent with FMI2, but then again, this is a breaking change. Looking for input/suggestions here.

@efredriksson-modelon efredriksson-modelon left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

👍

Comment thread src/pyfmi/fmi3.pyx Outdated
Comment thread src/pyfmi/fmi_algorithm_drivers.py Outdated

@efredriksson-modelon efredriksson-modelon left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

🍉

(but please consider tweaking the variable names 😄)

Comment thread src/pyfmi/fmi_algorithm_drivers.py Outdated
@PeterMeisrimelModelon
PeterMeisrimelModelon merged commit 72d88f5 into master Aug 11, 2026
2 checks passed
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.

2 participants