python-matplotlib/0003-TST-Increase-some-tole...

389 lines
15 KiB
Diff
Raw Normal View History

2018-01-21 09:05:53 +00:00
From 61eac9a522a7907db3fe01680d249789d1cff710 Mon Sep 17 00:00:00 2001
From: Elliott Sales de Andrade <quantum.analyst@gmail.com>
Date: Sun, 15 Oct 2017 21:11:26 -0400
2018-01-21 09:05:53 +00:00
Subject: [PATCH 3/3] TST: Increase some tolerances for 32-bit systems.
Signed-off-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
---
lib/matplotlib/tests/test_artist.py | 3 ++-
lib/matplotlib/tests/test_axes.py | 42 ++++++++++++++++----------------
lib/matplotlib/tests/test_collections.py | 2 +-
lib/matplotlib/tests/test_colorbar.py | 11 +++++----
lib/matplotlib/tests/test_contour.py | 6 ++---
lib/matplotlib/tests/test_image.py | 2 +-
lib/matplotlib/tests/test_pickle.py | 2 +-
lib/matplotlib/tests/test_quiver.py | 2 +-
lib/matplotlib/tests/test_transforms.py | 2 +-
lib/mpl_toolkits/tests/test_mplot3d.py | 2 +-
10 files changed, 38 insertions(+), 36 deletions(-)
diff --git a/lib/matplotlib/tests/test_artist.py b/lib/matplotlib/tests/test_artist.py
2017-12-10 10:15:28 +00:00
index 786d50903..105714ef4 100644
--- a/lib/matplotlib/tests/test_artist.py
+++ b/lib/matplotlib/tests/test_artist.py
@@ -95,7 +95,8 @@ def test_collection_transform_of_none():
assert isinstance(c._transOffset, mtransforms.IdentityTransform)
-@image_comparison(baseline_images=["clip_path_clipping"], remove_text=True)
+@image_comparison(baseline_images=["clip_path_clipping"], remove_text=True,
+ tol=0.28)
def test_clipping():
exterior = mpath.Path.unit_rectangle().deepcopy()
exterior.vertices *= 4
diff --git a/lib/matplotlib/tests/test_axes.py b/lib/matplotlib/tests/test_axes.py
2018-01-21 09:05:53 +00:00
index 6492cc140..8609d8c31 100644
--- a/lib/matplotlib/tests/test_axes.py
+++ b/lib/matplotlib/tests/test_axes.py
@@ -483,7 +483,7 @@ def test_single_point():
plt.plot('b', 'b', 'o', data=data)
-@image_comparison(baseline_images=['single_date'])
+@image_comparison(baseline_images=['single_date'], tol=1.97)
def test_single_date():
time1 = [721964.0]
data1 = [-65.54]
2018-01-21 09:05:53 +00:00
@@ -971,7 +971,7 @@ def test_fill_between_interpolate():
@image_comparison(baseline_images=['fill_between_interpolate_decreasing'],
- style='mpl20', remove_text=True)
+ style='mpl20', remove_text=True, tol=0.78)
def test_fill_between_interpolate_decreasing():
p = np.array([724.3, 700, 655])
t = np.array([9.4, 7, 2.2])
2018-01-21 09:05:53 +00:00
@@ -1085,7 +1085,7 @@ def test_pcolormesh():
@image_comparison(baseline_images=['pcolormesh_datetime_axis'],
- extensions=['png'], remove_text=False)
+ extensions=['png'], remove_text=False, tol=0.19)
def test_pcolormesh_datetime_axis():
fig = plt.figure()
fig.subplots_adjust(hspace=0.4, top=0.98, bottom=.15)
2018-01-21 09:05:53 +00:00
@@ -1111,7 +1111,7 @@ def test_pcolormesh_datetime_axis():
@image_comparison(baseline_images=['pcolor_datetime_axis'],
- extensions=['png'], remove_text=False)
+ extensions=['png'], remove_text=False, tol=0.19)
def test_pcolor_datetime_axis():
fig = plt.figure()
fig.subplots_adjust(hspace=0.4, top=0.98, bottom=.15)
2018-01-21 09:05:53 +00:00
@@ -1167,7 +1167,7 @@ def test_canonical():
@image_comparison(baseline_images=['arc_angles'], remove_text=True,
- style='default', extensions=['png'])
+ style='default', extensions=['png'], tol=0.17)
def test_arc_angles():
from matplotlib import patches
# Ellipse parameters
2018-01-21 09:05:53 +00:00
@@ -2433,7 +2433,7 @@ def test_boxplot_mod_artist_after_plotting():
@image_comparison(baseline_images=['violinplot_vert_baseline',
'violinplot_vert_baseline'],
- extensions=['png'])
+ extensions=['png'], tol=0.24)
def test_vert_violinplot_baseline():
# First 9 digits of frac(sqrt(2))
np.random.seed(414213562)
2018-01-21 09:05:53 +00:00
@@ -2451,7 +2451,7 @@ def test_vert_violinplot_baseline():
@image_comparison(baseline_images=['violinplot_vert_showmeans'],
- extensions=['png'])
+ extensions=['png'], tol=0.23)
def test_vert_violinplot_showmeans():
ax = plt.axes()
# First 9 digits of frac(sqrt(3))
2018-01-21 09:05:53 +00:00
@@ -2462,7 +2462,7 @@ def test_vert_violinplot_showmeans():
@image_comparison(baseline_images=['violinplot_vert_showextrema'],
- extensions=['png'])
+ extensions=['png'], tol=0.23)
def test_vert_violinplot_showextrema():
ax = plt.axes()
# First 9 digits of frac(sqrt(5))
2018-01-21 09:05:53 +00:00
@@ -2473,7 +2473,7 @@ def test_vert_violinplot_showextrema():
@image_comparison(baseline_images=['violinplot_vert_showmedians'],
- extensions=['png'])
+ extensions=['png'], tol=0.23)
def test_vert_violinplot_showmedians():
ax = plt.axes()
# First 9 digits of frac(sqrt(7))
2018-01-21 09:05:53 +00:00
@@ -2484,7 +2484,7 @@ def test_vert_violinplot_showmedians():
@image_comparison(baseline_images=['violinplot_vert_showall'],
- extensions=['png'])
+ extensions=['png'], tol=0.2)
def test_vert_violinplot_showall():
ax = plt.axes()
# First 9 digits of frac(sqrt(11))
2018-01-21 09:05:53 +00:00
@@ -2495,7 +2495,7 @@ def test_vert_violinplot_showall():
@image_comparison(baseline_images=['violinplot_vert_custompoints_10'],
- extensions=['png'])
+ extensions=['png'], tol=0.22)
def test_vert_violinplot_custompoints_10():
ax = plt.axes()
# First 9 digits of frac(sqrt(13))
2018-01-21 09:05:53 +00:00
@@ -2506,7 +2506,7 @@ def test_vert_violinplot_custompoints_10():
@image_comparison(baseline_images=['violinplot_vert_custompoints_200'],
- extensions=['png'])
+ extensions=['png'], tol=0.22)
def test_vert_violinplot_custompoints_200():
ax = plt.axes()
# First 9 digits of frac(sqrt(17))
2018-01-21 09:05:53 +00:00
@@ -2517,7 +2517,7 @@ def test_vert_violinplot_custompoints_200():
@image_comparison(baseline_images=['violinplot_horiz_baseline'],
- extensions=['png'])
+ extensions=['png'], tol=0.2)
def test_horiz_violinplot_baseline():
ax = plt.axes()
# First 9 digits of frac(sqrt(19))
2018-01-21 09:05:53 +00:00
@@ -2528,7 +2528,7 @@ def test_horiz_violinplot_baseline():
@image_comparison(baseline_images=['violinplot_horiz_showmedians'],
- extensions=['png'])
+ extensions=['png'], tol=0.23)
def test_horiz_violinplot_showmedians():
ax = plt.axes()
# First 9 digits of frac(sqrt(23))
2018-01-21 09:05:53 +00:00
@@ -2539,7 +2539,7 @@ def test_horiz_violinplot_showmedians():
@image_comparison(baseline_images=['violinplot_horiz_showmeans'],
- extensions=['png'])
+ extensions=['png'], tol=0.25)
def test_horiz_violinplot_showmeans():
ax = plt.axes()
# First 9 digits of frac(sqrt(29))
2018-01-21 09:05:53 +00:00
@@ -2550,7 +2550,7 @@ def test_horiz_violinplot_showmeans():
@image_comparison(baseline_images=['violinplot_horiz_showextrema'],
- extensions=['png'])
+ extensions=['png'], tol=0.2)
def test_horiz_violinplot_showextrema():
ax = plt.axes()
# First 9 digits of frac(sqrt(31))
2018-01-21 09:05:53 +00:00
@@ -2561,7 +2561,7 @@ def test_horiz_violinplot_showextrema():
@image_comparison(baseline_images=['violinplot_horiz_showall'],
- extensions=['png'])
+ extensions=['png'], tol=0.19)
def test_horiz_violinplot_showall():
ax = plt.axes()
# First 9 digits of frac(sqrt(37))
2018-01-21 09:05:53 +00:00
@@ -2572,7 +2572,7 @@ def test_horiz_violinplot_showall():
@image_comparison(baseline_images=['violinplot_horiz_custompoints_10'],
- extensions=['png'])
+ extensions=['png'], tol=0.22)
def test_horiz_violinplot_custompoints_10():
ax = plt.axes()
# First 9 digits of frac(sqrt(41))
2018-01-21 09:05:53 +00:00
@@ -2583,7 +2583,7 @@ def test_horiz_violinplot_custompoints_10():
@image_comparison(baseline_images=['violinplot_horiz_custompoints_200'],
- extensions=['png'])
+ extensions=['png'], tol=0.22)
def test_horiz_violinplot_custompoints_200():
ax = plt.axes()
# First 9 digits of frac(sqrt(43))
2018-01-21 09:05:53 +00:00
@@ -3909,7 +3909,7 @@ def test_psd_noise():
@image_comparison(baseline_images=['csd_freqs'], remove_text=True,
- extensions=['png'])
+ extensions=['png'], tol=0.21)
def test_csd_freqs():
'''test axes.csd with sinusoidal stimuli'''
n = 10000
2018-01-21 09:05:53 +00:00
@@ -5153,7 +5153,7 @@ def test_date_timezone_y():
@image_comparison(baseline_images=['date_timezone_x_and_y'],
- extensions=['png'])
+ extensions=['png'], tol=3.05)
def test_date_timezone_x_and_y():
# Tests issue 5575
time_index = [pytz.timezone('UTC').localize(datetime.datetime(
diff --git a/lib/matplotlib/tests/test_collections.py b/lib/matplotlib/tests/test_collections.py
index c27aeb11a..9d39a3e91 100644
--- a/lib/matplotlib/tests/test_collections.py
+++ b/lib/matplotlib/tests/test_collections.py
@@ -468,7 +468,7 @@ def test_EllipseCollection():
@image_comparison(baseline_images=['polycollection_close'],
- extensions=['png'], remove_text=True)
+ extensions=['png'], remove_text=True, tol=0.45)
def test_polycollection_close():
from mpl_toolkits.mplot3d import Axes3D
diff --git a/lib/matplotlib/tests/test_colorbar.py b/lib/matplotlib/tests/test_colorbar.py
index b75ba7e9f..cfbb16444 100644
--- a/lib/matplotlib/tests/test_colorbar.py
+++ b/lib/matplotlib/tests/test_colorbar.py
@@ -96,7 +96,7 @@ def _colorbar_extension_length(spacing):
@image_comparison(
baseline_images=['colorbar_extensions_shape_uniform',
'colorbar_extensions_shape_proportional'],
- extensions=['png'])
+ extensions=['png'], tol=0.16)
def test_colorbar_extension_shape():
'''Test rectangular colorbar extensions.'''
# Create figures for uniform and proportionally spaced colorbars.
@@ -106,7 +106,7 @@ def test_colorbar_extension_shape():
@image_comparison(baseline_images=['colorbar_extensions_uniform',
'colorbar_extensions_proportional'],
- extensions=['png'])
+ extensions=['png'], tol=0.25)
def test_colorbar_extension_length():
'''Test variable length colorbar extensions.'''
# Create figures for uniform and proportionally spaced colorbars.
@@ -120,7 +120,7 @@ def test_colorbar_extension_length():
'cbar_sharing',
],
extensions=['png'], remove_text=True,
- savefig_kwarg={'dpi': 40})
+ savefig_kwarg={'dpi': 40}, tol=0.17)
def test_colorbar_positioning():
data = np.arange(1200).reshape(30, 40)
levels = [0, 200, 400, 600, 800, 1000, 1200]
@@ -174,7 +174,7 @@ def test_colorbar_positioning():
@image_comparison(baseline_images=['cbar_with_subplots_adjust'],
extensions=['png'], remove_text=True,
- savefig_kwarg={'dpi': 40})
+ savefig_kwarg={'dpi': 40}, tol=0.17)
def test_gridspec_make_colorbar():
plt.figure()
data = np.arange(1200).reshape(30, 40)
@@ -234,7 +234,8 @@ def test_colorbarbase():
@image_comparison(
baseline_images=['colorbar_closed_patch'],
- remove_text=True)
+ remove_text=True,
+ tol=0.22)
def test_colorbar_closed_patch():
fig = plt.figure(figsize=(8, 6))
ax1 = fig.add_axes([0.05, 0.85, 0.9, 0.1])
diff --git a/lib/matplotlib/tests/test_contour.py b/lib/matplotlib/tests/test_contour.py
2017-12-10 10:15:28 +00:00
index 16ac9e865..29c1b26f2 100644
--- a/lib/matplotlib/tests/test_contour.py
+++ b/lib/matplotlib/tests/test_contour.py
2017-12-10 10:15:28 +00:00
@@ -228,7 +228,7 @@ def test_given_colors_levels_and_extends():
@image_comparison(baseline_images=['contour_datetime_axis'],
- extensions=['png'], remove_text=False)
+ extensions=['png'], remove_text=False, tol=0.18)
def test_contour_datetime_axis():
fig = plt.figure()
fig.subplots_adjust(hspace=0.4, top=0.98, bottom=.15)
2017-12-10 10:15:28 +00:00
@@ -254,7 +254,7 @@ def test_contour_datetime_axis():
@image_comparison(baseline_images=['contour_test_label_transforms'],
- extensions=['png'], remove_text=True)
+ extensions=['png'], remove_text=True, tol=0.74)
def test_labels():
# Adapted from pylab_examples example code: contour_demo.py
# see issues #2475, #2843, and #2818 for explanation
2017-12-10 10:15:28 +00:00
@@ -283,7 +283,7 @@ def test_labels():
@image_comparison(baseline_images=['contour_corner_mask_False',
'contour_corner_mask_True'],
- extensions=['png'], remove_text=True)
+ extensions=['png'], remove_text=True, tol=0.19)
def test_corner_mask():
n = 60
mask_level = 0.95
diff --git a/lib/matplotlib/tests/test_image.py b/lib/matplotlib/tests/test_image.py
2018-01-21 09:05:53 +00:00
index fd6430d56..e9bf1b1db 100644
--- a/lib/matplotlib/tests/test_image.py
+++ b/lib/matplotlib/tests/test_image.py
2017-12-10 10:15:28 +00:00
@@ -754,7 +754,7 @@ def test_imshow_endianess():
@image_comparison(baseline_images=['imshow_masked_interpolation'],
- remove_text=True, style='mpl20')
+ remove_text=True, style='mpl20', tol=0.25)
def test_imshow_masked_interpolation():
cm = copy(plt.get_cmap('viridis'))
diff --git a/lib/matplotlib/tests/test_pickle.py b/lib/matplotlib/tests/test_pickle.py
index bd6ac6862..512f07948 100644
--- a/lib/matplotlib/tests/test_pickle.py
+++ b/lib/matplotlib/tests/test_pickle.py
@@ -43,7 +43,7 @@ def test_simple():
@image_comparison(baseline_images=['multi_pickle'],
extensions=['png'], remove_text=True,
- style='mpl20')
+ style='mpl20', tol=0.11)
def test_complete():
fig = plt.figure('Figure with a label?', figsize=(10, 6))
diff --git a/lib/matplotlib/tests/test_quiver.py b/lib/matplotlib/tests/test_quiver.py
index a0e1e674f..ede6bfc64 100644
--- a/lib/matplotlib/tests/test_quiver.py
+++ b/lib/matplotlib/tests/test_quiver.py
@@ -131,7 +131,7 @@ def test_quiver_key_pivot():
@image_comparison(baseline_images=['barbs_test_image'],
- extensions=['png'], remove_text=True)
+ extensions=['png'], remove_text=True, tol=0.11)
def test_barbs():
x = np.linspace(-5, 5, 5)
X, Y = np.meshgrid(x, x)
diff --git a/lib/matplotlib/tests/test_transforms.py b/lib/matplotlib/tests/test_transforms.py
2018-01-21 09:05:53 +00:00
index 8f19a50f3..fa4a9aa18 100644
--- a/lib/matplotlib/tests/test_transforms.py
+++ b/lib/matplotlib/tests/test_transforms.py
@@ -75,7 +75,7 @@ def test_external_transform_api():
@image_comparison(baseline_images=['pre_transform_data'],
- tol=0.08)
2018-01-21 09:05:53 +00:00
+ tol=0.155)
def test_pre_transform_plotting():
# a catch-all for as many as possible plot layouts which handle
# pre-transforming the data NOTE: The axis range is important in this
diff --git a/lib/mpl_toolkits/tests/test_mplot3d.py b/lib/mpl_toolkits/tests/test_mplot3d.py
index c13f3be2f..81a28aadb 100644
--- a/lib/mpl_toolkits/tests/test_mplot3d.py
+++ b/lib/mpl_toolkits/tests/test_mplot3d.py
@@ -198,7 +198,7 @@ def test_text3d():
ax.set_zlabel('Z axis')
-@image_comparison(baseline_images=['trisurf3d'], remove_text=True, tol=0.03)
+@image_comparison(baseline_images=['trisurf3d'], remove_text=True, tol=0.05)
def test_trisurf3d():
n_angles = 36
n_radii = 8
--
2018-01-21 09:05:53 +00:00
2.14.3