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

Skip to content

Remove soon to be deprecated nan/inf aliases #26458

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions lib/matplotlib/tests/test_axes.py
Original file line number Diff line number Diff line change
Expand Up @@ -1479,7 +1479,7 @@ def test_pcolorargs():
ax.pcolormesh(x, y, Z[:-1, :-1], shading="gouraud")
with pytest.raises(TypeError):
ax.pcolormesh(X, Y, Z[:-1, :-1], shading="gouraud")
x[0] = np.NaN
x[0] = np.nan
with pytest.raises(ValueError):
ax.pcolormesh(x, y, Z[:-1, :-1])
with np.errstate(invalid='ignore'):
Expand Down Expand Up @@ -7411,7 +7411,7 @@ def test_limits_after_scroll_zoom():
def test_gettightbbox_ignore_nan():
fig, ax = plt.subplots()
remove_ticks_and_titles(fig)
ax.text(np.NaN, 1, 'Boo')
ax.text(np.nan, 1, 'Boo')
renderer = fig.canvas.get_renderer()
np.testing.assert_allclose(ax.get_tightbbox(renderer).width, 496)

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

barx[0] = np.NaN
barx[0] = np.nan

fig, ax = plt.subplots()

Expand Down
6 changes: 3 additions & 3 deletions lib/matplotlib/tests/test_colors.py
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ def test_BoundaryNorm():

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

# Without interpolation
ncolors = len(boundaries) - 1
Expand All @@ -353,9 +353,9 @@ def test_BoundaryNorm():
assert_array_equal(bn(vals), expected)

# Non-trivial masked arrays
vals = np.ma.masked_invalid([np.Inf, np.NaN])
vals = np.ma.masked_invalid([np.inf, np.nan])
assert np.all(bn(vals).mask)
vals = np.ma.masked_invalid([np.Inf])
vals = np.ma.masked_invalid([np.inf])
assert np.all(bn(vals).mask)

# Incompatible extend and clip
Expand Down
2 changes: 1 addition & 1 deletion lib/matplotlib/tests/test_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -1376,7 +1376,7 @@ def test_rgba_antialias():
aa[:, int(N/2):] = a[:, int(N/2):]

# set some over/unders and NaNs
aa[20:50, 20:50] = np.NaN
aa[20:50, 20:50] = np.nan
aa[70:90, 70:90] = 1e6
aa[70:90, 20:30] = -1e6
aa[70:90, 195:215] = 1e6
Expand Down