python-matplotlib/0004-Increase-a-few-test-tolerances-on-some-arches.patch
Elliott Sales de Andrade d965724300 Increase another tolerance
2021-10-02 05:14:38 -04:00

107 lines
4.2 KiB
Diff

From ce44fc4f778f3e7d781f5d812e86b10dff2ee1fc Mon Sep 17 00:00:00 2001
From: Elliott Sales de Andrade <quantum.analyst@gmail.com>
Date: Tue, 24 Aug 2021 04:47:50 -0400
Subject: [PATCH 4/4] Increase a few test tolerances on some arches.
Signed-off-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
---
lib/matplotlib/tests/test_axes.py | 6 ++++--
lib/matplotlib/tests/test_contour.py | 3 ++-
lib/matplotlib/tests/test_image.py | 4 ++--
lib/matplotlib/tests/test_lines.py | 4 +++-
lib/matplotlib/tests/test_streamplot.py | 3 ++-
5 files changed, 13 insertions(+), 7 deletions(-)
diff --git a/lib/matplotlib/tests/test_axes.py b/lib/matplotlib/tests/test_axes.py
index 472e0e6902..a5e678d048 100644
--- a/lib/matplotlib/tests/test_axes.py
+++ b/lib/matplotlib/tests/test_axes.py
@@ -868,7 +868,8 @@ def test_imshow():
ax.imshow("r", data=data)
-@image_comparison(['imshow_clip'], style='mpl20')
+@image_comparison(['imshow_clip'], style='mpl20',
+ tol=0 if platform.machine() == 'x86_64' else 1.24)
def test_imshow_clip():
# As originally reported by Gellule Xg <gellule.xg@free.fr>
# use former defaults to match existing baseline image
@@ -2060,7 +2061,8 @@ def test_contour_hatching():
extend='both', alpha=0.5)
-@image_comparison(['contour_colorbar'], style='mpl20')
+@image_comparison(['contour_colorbar'], style='mpl20',
+ tol=0 if platform.machine() == 'x86_64' else 0.02)
def test_contour_colorbar():
x, y, z = contour_dat()
diff --git a/lib/matplotlib/tests/test_contour.py b/lib/matplotlib/tests/test_contour.py
index 6396105f12..ea13615e4b 100644
--- a/lib/matplotlib/tests/test_contour.py
+++ b/lib/matplotlib/tests/test_contour.py
@@ -341,7 +341,8 @@ def test_contourf_log_extension():
@image_comparison(['contour_addlines.png'],
- remove_text=True, style='mpl20', tol=0.03)
+ remove_text=True, style='mpl20',
+ tol=0.03 if platform.machine() == 'x86_64' else 0.15)
# tolerance is because image changed minutely when tick finding on
# colorbars was cleaned up...
def test_contour_addlines():
diff --git a/lib/matplotlib/tests/test_image.py b/lib/matplotlib/tests/test_image.py
index 2c4a2763e4..b41bca0863 100644
--- a/lib/matplotlib/tests/test_image.py
+++ b/lib/matplotlib/tests/test_image.py
@@ -1322,8 +1322,8 @@ def test_nonuniform_and_pcolor():
ax.set(xlim=(0, 10))
-@image_comparison(["rgba_antialias.png"], style="mpl20",
- remove_text=True)
+@image_comparison(["rgba_antialias.png"], style="mpl20", remove_text=True,
+ tol=0 if platform.machine() == 'x86_64' else 0.007)
def test_rgba_antialias():
fig, axs = plt.subplots(2, 2, figsize=(3.5, 3.5), sharex=False,
sharey=False, constrained_layout=True)
diff --git a/lib/matplotlib/tests/test_lines.py b/lib/matplotlib/tests/test_lines.py
index f6917a134b..a7b5772e8c 100644
--- a/lib/matplotlib/tests/test_lines.py
+++ b/lib/matplotlib/tests/test_lines.py
@@ -3,6 +3,7 @@ Tests specific to the lines module.
"""
import itertools
+import platform
import timeit
from types import SimpleNamespace
@@ -162,7 +163,8 @@ def test_set_drawstyle():
assert len(line.get_path().vertices) == len(x)
-@image_comparison(['line_collection_dashes'], remove_text=True, style='mpl20')
+@image_comparison(['line_collection_dashes'], remove_text=True, style='mpl20',
+ tol=0 if platform.machine() == 'x86_64' else 0.62)
def test_set_line_coll_dash_image():
fig, ax = plt.subplots()
np.random.seed(0)
diff --git a/lib/matplotlib/tests/test_streamplot.py b/lib/matplotlib/tests/test_streamplot.py
index 88c3ec2768..3e0c8a76ab 100644
--- a/lib/matplotlib/tests/test_streamplot.py
+++ b/lib/matplotlib/tests/test_streamplot.py
@@ -34,7 +34,8 @@ def test_startpoints():
plt.plot(start_x, start_y, 'ok')
-@image_comparison(['streamplot_colormap'], remove_text=True, style='mpl20')
+@image_comparison(['streamplot_colormap'], remove_text=True, style='mpl20',
+ tol=0.01)
def test_colormap():
X, Y, U, V = velocity_field()
plt.streamplot(X, Y, U, V, color=U, density=0.6, linewidth=2,
--
2.31.1