Skip to content

Commit 039e416

Browse files
author
J. Scott Berg
committed
test_patch_bounds: use numpy in place of math/sys
1 parent 2e71850 commit 039e416

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

lib/matplotlib/tests/test_axes.py

+3-9
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@
3434
assert_allclose, assert_array_equal, assert_array_almost_equal)
3535
from matplotlib import rc_context
3636
from matplotlib.cbook import MatplotlibDeprecationWarning
37-
import sys
38-
import math
3937

4038
# Note: Some test cases are run twice: once normally and once with labeled data
4139
# These two must be defined in the same test function or need to have
@@ -6930,11 +6928,7 @@ def test_bar_label_labels():
69306928

69316929
def test_patch_bounds(): # PR 19078
69326930
fig, ax = plt.subplots()
6933-
tol = 16*sys.float_info.epsilon
69346931
ax.add_patch(mpatches.Wedge((0, -1), 1.05, 60, 120, 0.1))
6935-
bounds = ax.dataLim.bounds
6936-
bot = 1.9*math.sin(15*math.pi/180)**2
6937-
assert abs(bounds[0]+0.525) < tol and \
6938-
abs(bounds[1]+(bot+0.05)) < tol and \
6939-
abs(bounds[2]-1.05) < tol and \
6940-
abs(bounds[3]-(bot+0.1)) < tol
6932+
bot = 1.9*np.sin(15*np.pi/180)**2
6933+
np.testing.assert_array_almost_equal_nulp(
6934+
np.array((-0.525, -(bot+0.05), 1.05, bot+0.1)), ax.dataLim.bounds, 16)

0 commit comments

Comments
 (0)