Skip to content

Step event diagnostics - #427

Merged
efredriksson-modelon merged 6 commits into
masterfrom
dev-ef-step-event-diagnostics
Nov 20, 2026
Merged

efredriksson-modelon merged 6 commits into
masterfrom
dev-ef-step-event-diagnostics

Conversation

@efredriksson-modelon

@efredriksson-modelon efredriksson-modelon commented Nov 18, 2026 •

Copy link
Copy Markdown
Collaborator

Review commit by commit, but note the final commit first which collapses fixes as I decided to fix things in Assimulo instead. See modelon-community/Assimulo#142.

I will amend the history if we are happy with this solution.

@efredriksson-modelon
efredriksson-modelon force-pushed the dev-ef-step-event-diagnostics branch from 8859777 to b6f6a3b Compare November 18, 2026 16:56
@efredriksson-modelon
efredriksson-modelon marked this pull request as ready for review November 18, 2026 16:57
@efredriksson-modelon efredriksson-modelon self-assigned this Nov 18, 2026

@PeterMeisrimelModelon PeterMeisrimelModelon 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.

Looks great overall, a few mixed comments.

Comment thread src/common/diagnostics.py Resolved
Comment thread CHANGELOG Resolved
Comment thread tests/test_fmi2.py Resolved
Comment thread tests/test_fmi2.py Resolved
Comment thread tests/test_fmi2.py Resolved
Comment thread tests/test_fmi2.py Resolved
Comment thread tests/test_fmi3_sim.py Resolved
Comment thread CHANGELOG Resolved
Comment thread CHANGELOG Resolved
@efredriksson-modelon

Copy link
Copy Markdown
Collaborator Author

@PeterMeisrimelModelon Thanks for the review! I have added new commits for the changes. The history will need to be consolidated once Assimulo is in and changes are OK.

The values of @Diagnostics.event_data.event_info.event_type (-1, 0, 1)
were literals spread over the FMI2/FMI3 problem classes, the calculated
diagnostics and the tests. EventType in pyfmi.common.diagnostics is now
the one definition, and the variable's description is built from it.
step_events ran an event iteration for a step event and then returned
1. Assimulo turns that return into an event and runs another, so each
step event got two. step_events now only returns 1.

The test checks every solver. Assimulo 3.5.0 through 3.8.0 share this
flow.
Assimulo 3.9 passes step event info to handle_event, which the step
event diagnostics depend on. The Dockerfile builds the 3.9.0 tag.
Assimulo reports a step event as a state event, and Radau5ODE crashed
on it with `logging = True`. Assimulo 3.9 passes the step event in
event_info[2]. A step event now gets event type STEP_EVENT (2) and is
counted in the new @Diagnostics.nbr_step_events. A state or time event
in the same solver step keeps its own type.
Without dynamic diagnostics, a step event was logged like a state event
that no indicator triggered. Each event now gets a "Step  event info"
line in the debug file and a step_event_info boolean in the XML log.
Existing lines are unchanged.
@efredriksson-modelon
efredriksson-modelon force-pushed the dev-ef-step-event-diagnostics branch from d67fb11 to 5196fb6 Compare November 20, 2026 14:45
@efredriksson-modelon
efredriksson-modelon merged commit 73ffb5e into master Nov 20, 2026
2 checks passed
@efredriksson-modelon
efredriksson-modelon deleted the dev-ef-step-event-diagnostics branch November 20, 2026 14:52
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