8000 Rename `valid_index` to `within_grid`. · matplotlib/matplotlib@398e8ec · GitHub
[go: up one dir, main page]

Skip to content

Commit 398e8ec

Browse files
committed
Rename valid_index to within_grid.
`valid_index` suggests that inputs are integer, which is not true.
1 parent ed29d17 commit 398e8ec

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/matplotlib/streamplot.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ def reset_start_point(self, xg, yg):
200200
self.mask._current_xy = (xm, ym)
201201

202202
def update_trajectory(self, xg, yg):
203-
if not self.grid.valid_index(xg, yg):
203+
if not self.grid.within_grid(xg, yg):
204204
raise InvalidIndexError
205205
xm, ym = self.grid2mask(xg, yg)
206206
self.mask._update_trajectory(xm, ym)
@@ -243,7 +243,7 @@ def __init__(self, x, y):
243243
def shape(self):
244244
return self.ny, self.nx
245245

246-
def valid_index(self, xi, yi):
246+
def within_grid(self, xi, yi):
247247
"""Return True if point is a valid index of grid."""
248248
# Note that xi/yi can be floats; so, for example, we can't simply check
249249
# `xi < self.nx` since `xi` can be `self.nx - 1 < xi < self.nx`
@@ -402,7 +402,7 @@ def _integrate_rk12(x0, y0, dmap, f):
402402
xf_traj = []
403403
yf_traj = []
404404

405-
while dmap.grid.valid_index(xi, yi):
405+
while dmap.grid.within_grid(xi, yi):
406406
xf_traj.append(xi)
407407
yf_traj.append(yi)
408408
try:

0 commit comments

Comments
 (0)
0