Skip to content

Report step events in event_info for solvers - #142

Merged
efredriksson-modelon merged 7 commits into
modelon-community:masterfrom
efredriksson-modelon:dev-ef-step-events
Nov 20, 2026
Merged

efredriksson-modelon merged 7 commits into
modelon-community:masterfrom
efredriksson-modelon:dev-ef-step-events

Conversation

@efredriksson-modelon

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

Copy link
Copy Markdown
Collaborator

Report step events in event_info for solvers.

handle_event now receives [state_event_info, time_event, step_event].
A step event replaces the solver's ID_COMPLETE with ID_EVENT, so a step
event at a time event reported time_event=False and skipped
ntimeevents. The driver now records step events and checks the time
event against tevent.

handle_event now receives [state_event_info, time_event, step_event].
A step event replaces the solver's ID_COMPLETE with ID_EVENT, so a step
event at a time event reported time_event=False and skipped
ntimeevents. The driver now records step events and checks the time
event against tevent.

Radau5ODE no longer sets _event_info to None.
Applies the explicit driver's change to the implicit driver, so IDA and
Radau5DAE report step events. Radau5DAE no longer sets _event_info
to None.

Not covered: ODASSL raises on any step event (it has no
state_event_info), and GLIMDA ignores step events.
A step event makes the driver ask the solver for state event info even
when the problem defines no state events. CVode and IDA then gave an
empty list and the other solvers an empty array. handle_event now
receives an empty list from every solver; other cases are unchanged.

The handle_event docstrings now say how to read the state event list:
by its non-zero entries.
@efredriksson-modelon efredriksson-modelon changed the title Step events Report step events in event_info for solvers Nov 18, 2026
@efredriksson-modelon
efredriksson-modelon marked this pull request as ready for review November 18, 2026 16:57
@efredriksson-modelon

Copy link
Copy Markdown
Collaborator Author

@PeterMeisrimelModelon I don't have permissions for this repo, can you add yourself as reviewer and assign me for now until I get permissions?

@PeterMeisrimelModelon

Copy link
Copy Markdown
Collaborator

@PeterMeisrimelModelon I don't have permissions for this repo, can you add yourself as reviewer and assign me for now until I get permissions?

Cannot assign you, because you don't have permissions

@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 good to me! I think the tests could be improved a bit to increase readability/clarity.

Comment thread tests/test_event_info.py Resolved
Comment thread tests/test_event_info.py Resolved
Comment thread tests/test_event_info.py Resolved
Comment thread tests/test_event_info.py Resolved
Comment thread CHANGELOG Resolved
@efredriksson-modelon

Copy link
Copy Markdown
Collaborator Author

@PeterMeisrimelModelon Thanks for the review! Please have a look at the 2 new commits.

Comment thread CHANGELOG Resolved
@efredriksson-modelon
efredriksson-modelon merged commit d3bee4a into modelon-community:master Nov 20, 2026
5 of 6 checks passed
@efredriksson-modelon
efredriksson-modelon deleted the dev-ef-step-events branch November 20, 2026 14:11
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