python-matplotlib/0004-Update-aarch64-toleran...

224 lines
8.9 KiB
Diff

From 954ebfd469a0979e0817db96760ea1f5542f2729 Mon Sep 17 00:00:00 2001
From: Elliott Sales de Andrade <quantum.analyst@gmail.com>
Date: Mon, 29 Jun 2020 03:49:29 -0400
Subject: [PATCH 4/6] Update aarch64 tolerances.
Signed-off-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
---
lib/matplotlib/tests/test_backend_pgf.py | 6 +-----
lib/matplotlib/tests/test_collections.py | 4 +---
lib/matplotlib/tests/test_contour.py | 4 +++-
lib/matplotlib/tests/test_figure.py | 2 +-
lib/matplotlib/tests/test_image.py | 2 +-
lib/matplotlib/tests/test_legend.py | 4 ++--
lib/matplotlib/tests/test_patheffects.py | 2 +-
lib/matplotlib/tests/test_polar.py | 5 ++++-
lib/matplotlib/tests/test_streamplot.py | 4 +---
lib/matplotlib/tests/test_units.py | 4 ++--
lib/mpl_toolkits/tests/test_axes_grid1.py | 2 +-
11 files changed, 18 insertions(+), 21 deletions(-)
diff --git a/lib/matplotlib/tests/test_backend_pgf.py b/lib/matplotlib/tests/test_backend_pgf.py
index 2d125ad29..702cc6c35 100644
--- a/lib/matplotlib/tests/test_backend_pgf.py
+++ b/lib/matplotlib/tests/test_backend_pgf.py
@@ -8,7 +8,6 @@ from tempfile import TemporaryDirectory
import numpy as np
import pytest
-import platform
import matplotlib as mpl
import matplotlib.pyplot as plt
@@ -179,10 +178,7 @@ def test_pathclip():
# test mixed mode rendering
@needs_xelatex
@pytest.mark.backend('pgf')
-@image_comparison(['pgf_mixedmode.pdf'], style='default',
- tol={'aarch64': 1.086, 'x86_64': 1.086}.get(
- platform.machine(), 0.0
- ))
+@image_comparison(['pgf_mixedmode.pdf'], style='default')
def test_mixedmode():
rc_xelatex = {'font.family': 'serif',
'pgf.rcfonts': False}
diff --git a/lib/matplotlib/tests/test_collections.py b/lib/matplotlib/tests/test_collections.py
index 77f6e1884..d457fe372 100644
--- a/lib/matplotlib/tests/test_collections.py
+++ b/lib/matplotlib/tests/test_collections.py
@@ -1,5 +1,4 @@
import io
-import platform
from types import SimpleNamespace
import numpy as np
@@ -334,8 +333,7 @@ def test_barb_limits():
decimal=1)
-@image_comparison(['EllipseCollection_test_image.png'], remove_text=True,
- tol={'aarch64': 0.02}.get(platform.machine(), 0.0))
+@image_comparison(['EllipseCollection_test_image.png'], remove_text=True)
def test_EllipseCollection():
# Test basic functionality
fig, ax = plt.subplots()
diff --git a/lib/matplotlib/tests/test_contour.py b/lib/matplotlib/tests/test_contour.py
index 1a1c5f442..e233a2b79 100644
--- a/lib/matplotlib/tests/test_contour.py
+++ b/lib/matplotlib/tests/test_contour.py
@@ -1,4 +1,5 @@
import datetime
+import platform
import re
import numpy as np
@@ -189,7 +190,8 @@ def test_contour_datetime_axis():
@image_comparison(['contour_test_label_transforms.png'],
- remove_text=True, style='mpl20')
+ remove_text=True, style='mpl20',
+ tol={'aarch64': 0.08}.get(platform.machine(), 0))
def test_labels():
# Adapted from pylab_examples example code: contour_demo.py
# see issues #2475, #2843, and #2818 for explanation
diff --git a/lib/matplotlib/tests/test_figure.py b/lib/matplotlib/tests/test_figure.py
index bb1623509..2340f2199 100644
--- a/lib/matplotlib/tests/test_figure.py
+++ b/lib/matplotlib/tests/test_figure.py
@@ -22,7 +22,7 @@ import pytest
@image_comparison(['figure_align_labels'],
- tol={'aarch64': 0.02}.get(platform.machine(), 0.0))
+ tol={'aarch64': 0.01}.get(platform.machine(), 0))
def test_align_labels():
fig = plt.figure(tight_layout=True)
gs = gridspec.GridSpec(3, 3)
diff --git a/lib/matplotlib/tests/test_image.py b/lib/matplotlib/tests/test_image.py
index b5fd6e6fe..d07b80bef 100644
--- a/lib/matplotlib/tests/test_image.py
+++ b/lib/matplotlib/tests/test_image.py
@@ -861,7 +861,7 @@ def test_imshow_endianess():
@image_comparison(['imshow_masked_interpolation'],
- tol={'aarch64': 0.02}.get(platform.machine(), 0.0),
+ tol={'aarch64': 0.01}.get(platform.machine(), 0),
remove_text=True, style='mpl20')
def test_imshow_masked_interpolation():
diff --git a/lib/matplotlib/tests/test_legend.py b/lib/matplotlib/tests/test_legend.py
index df09a884b..b6ccb28dd 100644
--- a/lib/matplotlib/tests/test_legend.py
+++ b/lib/matplotlib/tests/test_legend.py
@@ -105,7 +105,7 @@ def test_multiple_keys():
@image_comparison(['rgba_alpha.png'], remove_text=True,
- tol={'aarch64': 0.02}.get(platform.machine(), 0.0))
+ tol={'aarch64': 0.01}.get(platform.machine(), 0))
def test_alpha_rgba():
fig, ax = plt.subplots(1, 1)
ax.plot(range(10), lw=5)
@@ -114,7 +114,7 @@ def test_alpha_rgba():
@image_comparison(['rcparam_alpha.png'], remove_text=True,
- tol={'aarch64': 0.02}.get(platform.machine(), 0.0))
+ tol={'aarch64': 0.01}.get(platform.machine(), 0))
def test_alpha_rcparam():
fig, ax = plt.subplots(1, 1)
ax.plot(range(10), lw=5)
diff --git a/lib/matplotlib/tests/test_patheffects.py b/lib/matplotlib/tests/test_patheffects.py
index d8c54e770..77b6ae314 100644
--- a/lib/matplotlib/tests/test_patheffects.py
+++ b/lib/matplotlib/tests/test_patheffects.py
@@ -115,7 +115,7 @@ def test_SimplePatchShadow_offset():
assert pe._offset == (4, 5)
-@image_comparison(['collection'], tol=0.02, style='mpl20')
+@image_comparison(['collection'], tol=0.03, style='mpl20')
def test_collection():
x, y = np.meshgrid(np.linspace(0, 10, 150), np.linspace(-5, 5, 100))
data = np.sin(x) + np.cos(y)
diff --git a/lib/matplotlib/tests/test_polar.py b/lib/matplotlib/tests/test_polar.py
index 3594a9224..7b5fd6af9 100644
--- a/lib/matplotlib/tests/test_polar.py
+++ b/lib/matplotlib/tests/test_polar.py
@@ -1,3 +1,5 @@
+import platform
+
import numpy as np
from numpy.testing import assert_allclose
import pytest
@@ -7,7 +9,8 @@ from matplotlib import pyplot as plt
from matplotlib.testing.decorators import image_comparison, check_figures_equal
-@image_comparison(['polar_axes'], style='default')
+@image_comparison(['polar_axes'], style='default',
+ tol={'aarch64': 0.01}.get(platform.machine(), 0))
def test_polar_annotations():
# You can specify the xypoint and the xytext in different positions and
# coordinate systems, and optionally turn on a connecting line and mark the
diff --git a/lib/matplotlib/tests/test_streamplot.py b/lib/matplotlib/tests/test_streamplot.py
index d2218f6f2..2e795c2a3 100644
--- a/lib/matplotlib/tests/test_streamplot.py
+++ b/lib/matplotlib/tests/test_streamplot.py
@@ -1,5 +1,4 @@
import sys
-import platform
import numpy as np
from numpy.testing import assert_array_almost_equal
@@ -48,8 +47,7 @@ def test_colormap():
plt.colorbar()
-@image_comparison(['streamplot_linewidth'], remove_text=True, style='mpl20',
- tol={'aarch64': 0.02}.get(platform.machine(), 0.0))
+@image_comparison(['streamplot_linewidth'], remove_text=True, style='mpl20')
def test_linewidth():
X, Y, U, V = velocity_field()
speed = np.hypot(U, V)
diff --git a/lib/matplotlib/tests/test_units.py b/lib/matplotlib/tests/test_units.py
index 25396ff0f..137b12aa9 100644
--- a/lib/matplotlib/tests/test_units.py
+++ b/lib/matplotlib/tests/test_units.py
@@ -74,7 +74,7 @@ def quantity_converter():
# Tests that the conversion machinery works properly for classes that
# work as a facade over numpy arrays (like pint)
@image_comparison(['plot_pint.png'], remove_text=False, style='mpl20',
- tol={'aarch64': 0.02}.get(platform.machine(), 0.0))
+ tol={'aarch64': 0.01}.get(platform.machine(), 0))
def test_numpy_facade(quantity_converter):
# use former defaults to match existing baseline image
plt.rcParams['axes.formatter.limits'] = -7, 7
@@ -101,7 +101,7 @@ def test_numpy_facade(quantity_converter):
# Tests gh-8908
@image_comparison(['plot_masked_units.png'], remove_text=True, style='mpl20',
- tol={'aarch64': 0.02}.get(platform.machine(), 0.0))
+ tol={'aarch64': 0.01}.get(platform.machine(), 0))
def test_plot_masked_units():
data = np.linspace(-5, 5)
data_masked = np.ma.array(data, mask=(data > -2) & (data < 2))
diff --git a/lib/mpl_toolkits/tests/test_axes_grid1.py b/lib/mpl_toolkits/tests/test_axes_grid1.py
index 0aa2c7600..30ea87445 100644
--- a/lib/mpl_toolkits/tests/test_axes_grid1.py
+++ b/lib/mpl_toolkits/tests/test_axes_grid1.py
@@ -331,7 +331,7 @@ def test_zooming_with_inverted_axes():
@image_comparison(['anchored_direction_arrows.png'],
- tol={'aarch64': 0.02}.get(platform.machine(), 0.0))
+ tol={'aarch64': 0.01}.get(platform.machine(), 0))
def test_anchored_direction_arrows():
fig, ax = plt.subplots()
ax.imshow(np.zeros((10, 10)), interpolation='nearest')
--
2.25.4