Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
s-m-e committed Jan 29, 2024
1 parent df53a1a commit 2e19322
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/hapsira/core/math/ivp/_solve.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,13 +127,12 @@ def _handle_events(
active_events = active_events[order]
roots = roots[order]
t = np.nonzero(terminals[active_events])[0][0]
active_events = active_events[: t + 1]
roots = roots[: t + 1]
terminate = True
else:
terminate = False

return active_events, roots, terminate
return roots, terminate


def _find_active_events(g, g_new, directions):
Expand Down Expand Up @@ -226,7 +225,7 @@ def solve_ivp(
event.last_t_raw = t
active_events = _find_active_events(g, g_new, directions)
if active_events.size > 0:
_, roots, terminate = _handle_events(
roots, terminate = _handle_events(
interpolant,
events,
active_events,
Expand Down

0 comments on commit 2e19322

Please sign in to comment.