Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

Commit039e416

Browse files
author
J. Scott Berg
committed
test_patch_bounds: use numpy in place of math/sys
1 parent2e71850 commit039e416

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

‎lib/matplotlib/tests/test_axes.py

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@
3434
assert_allclose,assert_array_equal,assert_array_almost_equal)
3535
frommatplotlibimportrc_context
3636
frommatplotlib.cbookimportMatplotlibDeprecationWarning
37-
importsys
38-
importmath
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
deftest_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-
assertabs(bounds[0]+0.525)<toland \
6938-
abs(bounds[1]+(bot+0.05))<toland \
6939-
abs(bounds[2]-1.05)<toland \
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)

[8]ページ先頭

©2009-2025 Movatter.jp