Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 28a9e27

Browse files
committed
Remove Terminated exception.
1 parent a88f621 commit 28a9e27

1 file changed

Lines changed: 3 additions & 8 deletions

File tree

lib/matplotlib/streamplot.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -302,9 +302,6 @@ class InvalidIndexError(Exception):
302302
class OutOfBounds(Exception):
303303
pass
304304

305-
class Terminated(Exception):
306-
pass
307-
308305

309306
# Integrator definitions
310307
#========================
@@ -432,12 +429,12 @@ def _rk12(x0, y0, dmap, f):
432429
try:
433430
dmap.update_trajectory(xi, yi)
434431
except InvalidIndexError:
435-
raise Terminated
432+
break
436433
if (stotal + ds) > 2:
437-
raise Terminated
434+
break
438435
stotal += ds
439436

440-
# recalculate stepsize based on Runge-Kutta-Fehlberg method
437+
# recalculate stepsize based on step error
441438
ds = min(maxds, 0.85 * ds * (maxerror/error)**0.2)
442439

443440
except OutOfBounds:
@@ -461,8 +458,6 @@ def _rk12(x0, y0, dmap, f):
461458
xf_traj.append(xi+cx*ds)
462459
yf_traj.append(yi+cy*ds)
463460
stotal += ds
464-
except Terminated:
465-
pass
466461

467462
return stotal, xf_traj, yf_traj
468463

0 commit comments

Comments
 (0)