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

Skip to content

Commit 2679b8e

Browse files
authored
Merge pull request #26459 from meeseeksmachine/auto-backport-of-pr-26458-on-v3.7.x
Backport PR #26458 on branch v3.7.x (Remove soon to be deprecated nan/inf aliases)
2 parents 314edc6 + 65c7d0b commit 2679b8e

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

lib/matplotlib/tests/test_axes.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1401,7 +1401,7 @@ def test_pcolorargs():
14011401
ax.pcolormesh(x, y, Z[:-1, :-1], shading="gouraud")
14021402
with pytest.raises(TypeError):
14031403
ax.pcolormesh(X, Y, Z[:-1, :-1], shading="gouraud")
1404-
x[0] = np.NaN
1404+
x[0] = np.nan
14051405
with pytest.raises(ValueError):
14061406
ax.pcolormesh(x, y, Z[:-1, :-1])
14071407
with np.errstate(invalid='ignore'):
@@ -7232,7 +7232,7 @@ def test_limits_after_scroll_zoom():
72327232
def test_gettightbbox_ignore_nan():
72337233
fig, ax = plt.subplots()
72347234
remove_ticks_and_titles(fig)
7235-
ax.text(np.NaN, 1, 'Boo')
7235+
ax.text(np.nan, 1, 'Boo')
72367236
renderer = fig.canvas.get_renderer()
72377237
np.testing.assert_allclose(ax.get_tightbbox(renderer).width, 496)
72387238

@@ -8390,7 +8390,7 @@ def test_bar_leading_nan():
83908390
barheights = np.array([0.5, 1.5, 2.0])
83918391
barstarts = np.array([0.77]*3)
83928392

8393-
barx[0] = np.NaN
8393+
barx[0] = np.nan
83948394

83958395
fig, ax = plt.subplots()
83968396

lib/matplotlib/tests/test_colors.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ def test_BoundaryNorm():
338338

339339
# Masked arrays
340340
boundaries = [0, 1.1, 2.2]
341-
vals = np.ma.masked_invalid([-1., np.NaN, 0, 1.4, 9])
341+
vals = np.ma.masked_invalid([-1., np.nan, 0, 1.4, 9])
342342

343343
# Without interpolation
344344
ncolors = len(boundaries) - 1
@@ -352,9 +352,9 @@ def test_BoundaryNorm():
352352
assert_array_equal(bn(vals), expected)
353353

354354
# Non-trivial masked arrays
355-
vals = np.ma.masked_invalid([np.Inf, np.NaN])
355+
vals = np.ma.masked_invalid([np.inf, np.nan])
356356
assert np.all(bn(vals).mask)
357-
vals = np.ma.masked_invalid([np.Inf])
357+
vals = np.ma.masked_invalid([np.inf])
358358
assert np.all(bn(vals).mask)
359359

360360
# Incompatible extend and clip

lib/matplotlib/tests/test_image.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1374,7 +1374,7 @@ def test_rgba_antialias():
13741374
aa[:, int(N/2):] = a[:, int(N/2):]
13751375

13761376
# set some over/unders and NaNs
1377-
aa[20:50, 20:50] = np.NaN
1377+
aa[20:50, 20:50] = np.nan
13781378
aa[70:90, 70:90] = 1e6
13791379
aa[70:90, 20:30] = -1e6
13801380
aa[70:90, 195:215] = 1e6

0 commit comments

Comments
 (0)