Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 2635e13

Browse filesBrowse files
committed
Remove soon to be deprecated nan/inf aliases
1 parent 440f761 commit 2635e13
Copy full SHA for 2635e13

File tree

Expand file treeCollapse file tree

3 files changed

+7
-7
lines changed
Filter options
Expand file treeCollapse file tree

3 files changed

+7
-7
lines changed

‎lib/matplotlib/tests/test_axes.py

Copy file name to clipboardExpand all lines: lib/matplotlib/tests/test_axes.py
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1479,7 +1479,7 @@ def test_pcolorargs():
14791479
ax.pcolormesh(x, y, Z[:-1, :-1], shading="gouraud")
14801480
with pytest.raises(TypeError):
14811481
ax.pcolormesh(X, Y, Z[:-1, :-1], shading="gouraud")
1482-
x[0] = np.NaN
1482+
x[0] = np.nan
14831483
with pytest.raises(ValueError):
14841484
ax.pcolormesh(x, y, Z[:-1, :-1])
14851485
with np.errstate(invalid='ignore'):
@@ -7411,7 +7411,7 @@ def test_limits_after_scroll_zoom():
74117411
def test_gettightbbox_ignore_nan():
74127412
fig, ax = plt.subplots()
74137413
remove_ticks_and_titles(fig)
7414-
ax.text(np.NaN, 1, 'Boo')
7414+
ax.text(np.nan, 1, 'Boo')
74157415
renderer = fig.canvas.get_renderer()
74167416
np.testing.assert_allclose(ax.get_tightbbox(renderer).width, 496)
74177417

@@ -8591,7 +8591,7 @@ def test_bar_leading_nan():
85918591
barheights = np.array([0.5, 1.5, 2.0])
85928592
barstarts = np.array([0.77]*3)
85938593

8594-
barx[0] = np.NaN
8594+
barx[0] = np.nan
85958595

85968596
fig, ax = plt.subplots()
85978597

‎lib/matplotlib/tests/test_colors.py

Copy file name to clipboardExpand all lines: lib/matplotlib/tests/test_colors.py
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ def test_BoundaryNorm():
339339

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

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

355355
# Non-trivial masked arrays
356-
vals = np.ma.masked_invalid([np.Inf, np.NaN])
356+
vals = np.ma.masked_invalid([np.inf, np.nan])
357357
assert np.all(bn(vals).mask)
358-
vals = np.ma.masked_invalid([np.Inf])
358+
vals = np.ma.masked_invalid([np.inf])
359359
assert np.all(bn(vals).mask)
360360

361361
# Incompatible extend and clip

‎lib/matplotlib/tests/test_image.py

Copy file name to clipboardExpand all lines: lib/matplotlib/tests/test_image.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1376,7 +1376,7 @@ def test_rgba_antialias():
13761376
aa[:, int(N/2):] = a[:, int(N/2):]
13771377

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

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.