end simulation correction when simulation has callbacks#815
Conversation
|
Thanks for reporting the bug. I think that for backends that round The problem with your proposed solution is that it stops the callback loop up to a full timestep early, even in the normal on-grid case, so Could we instead use the same half-timestep tolerance already applied a few lines above (the This terminates the off-grid case (it stops once within half a timestep of the target, which is the grid-rounding tolerance) without stopping short or dropping the final-timestep callbacks. It'd also be worth adding a regression test that reproduces the hang. The existing |
Sometimes with long simulations with callbacks, the simulation never ends. Here is a small correction in the run_until() method in the control.py file that eliminates this issue.