Skip to content

Fix EventHandlingSimulator::get_simulation_state#2901

Merged
dweindl merged 1 commit intoAMICI-dev:mainfrom
dweindl:fix_getsimulationstate
Jul 16, 2025
Merged

Fix EventHandlingSimulator::get_simulation_state#2901
dweindl merged 1 commit intoAMICI-dev:mainfrom
dweindl:fix_getsimulationstate

Conversation

@dweindl
Copy link
Member

@dweindl dweindl commented Jul 16, 2025

Previously, get_simulation_state not only created a SimulationState but also updated the current workspace. This is unexpected and causes problems when handling nested events when the workspace is updated but the solver was not reinitialized yet (kind of reverting the primary event assignment). Thus, decouple snapshotting of the current state from pulling Solver state.

@dweindl dweindl self-assigned this Jul 16, 2025
@codecov
Copy link

codecov bot commented Jul 16, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.72%. Comparing base (e728c2a) to head (e485009).
⚠️ Report is 63 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2901      +/-   ##
==========================================
- Coverage   80.31%   79.72%   -0.59%     
==========================================
  Files         330      330              
  Lines       22641    22634       -7     
  Branches     1532     1530       -2     
==========================================
- Hits        18184    18046     -138     
- Misses       4447     4578     +131     
  Partials       10       10              
Flag Coverage Δ
cpp 75.50% <100.00%> (-0.01%) ⬇️
cpp_python 33.77% <100.00%> (-0.02%) ⬇️
petab 39.19% <100.00%> (-0.02%) ⬇️
python 74.48% <100.00%> (-0.01%) ⬇️
sbmlsuite-jax ?

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/forwardproblem.cpp 89.55% <100.00%> (+0.04%) ⬆️

... and 6 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Previously, `get_simulation_state` not only created a `SimulationState` but also updated the current workspace.
This is unexpected and causes problems when handling nested events when the workspace is updated but the solver was not reinitialized yet (kind of reverting the primary event assignment).
Thus, decouple snapshotting of the current state from pulling Solver state.
@dweindl dweindl force-pushed the fix_getsimulationstate branch from 69efb9a to e485009 Compare July 16, 2025 10:35
@dweindl dweindl marked this pull request as ready for review July 16, 2025 11:51
@dweindl dweindl requested a review from a team as a code owner July 16, 2025 11:51
@dweindl dweindl added this pull request to the merge queue Jul 16, 2025
Merged via the queue into AMICI-dev:main with commit f83f92d Jul 16, 2025
26 of 27 checks passed
@dweindl dweindl deleted the fix_getsimulationstate branch July 16, 2025 19:08
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