@@ -200,7 +200,7 @@ def reset_start_point(self, xg, yg):
200
200
self .mask ._current_xy = (xm , ym )
201
201
202
202
def update_trajectory (self , xg , yg ):
203
- if not self .grid .valid_index (xg , yg ):
203
+ if not self .grid .within_grid (xg , yg ):
204
204
raise InvalidIndexError
205
205
xm , ym = self .grid2mask (xg , yg )
206
206
self .mask ._update_trajectory (xm , ym )
@@ -243,7 +243,7 @@ def __init__(self, x, y):
243
243
def shape (self ):
244
244
return self .ny , self .nx
245
245
246
- def valid_index (self , xi , yi ):
246
+ def within_grid (self , xi , yi ):
247
247
"""Return True if point is a valid index of grid."""
248
248
# Note that xi/yi can be floats; so, for example, we can't simply check
249
249
# `xi < self.nx` since `xi` can be `self.nx - 1 < xi < self.nx`
@@ -402,7 +402,7 @@ def _integrate_rk12(x0, y0, dmap, f):
402
402
xf_traj = []
403
403
yf_traj = []
404
404
405
- while dmap .grid .valid_index (xi , yi ):
405
+ while dmap .grid .within_grid (xi , yi ):
406
406
xf_traj .append (xi )
407
407
yf_traj .append (yi )
408
408
try :
0 commit comments