Simplify and update patches.
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
From 0420e360523e3452467bfc7d9bb19c3593cde2e7 Mon Sep 17 00:00:00 2001
|
||||
From: Elliott Sales de Andrade <quantum.analyst@gmail.com>
|
||||
Date: Thu, 5 Oct 2017 21:26:53 -0400
|
||||
Subject: [PATCH 1/8] TST: Skip sphinxext if unavailable instead of error.
|
||||
|
||||
Signed-off-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
|
||||
---
|
||||
lib/matplotlib/sphinxext/tests/test_tinypages.py | 3 +--
|
||||
1 file changed, 1 insertion(+), 2 deletions(-)
|
||||
|
||||
diff --git a/lib/matplotlib/sphinxext/tests/test_tinypages.py b/lib/matplotlib/sphinxext/tests/test_tinypages.py
|
||||
index 5141a4cdd..6ee3e9e07 100644
|
||||
--- a/lib/matplotlib/sphinxext/tests/test_tinypages.py
|
||||
+++ b/lib/matplotlib/sphinxext/tests/test_tinypages.py
|
||||
@@ -22,8 +22,7 @@ def setup_module():
|
||||
ret = call([sys.executable, '-msphinx', '--help'],
|
||||
stdout=PIPE, stderr=PIPE)
|
||||
if ret != 0:
|
||||
- raise RuntimeError(
|
||||
- "'{} -msphinx' does not return 0".format(sys.executable))
|
||||
+ pytest.skip("'{} -msphinx' does not return 0".format(sys.executable))
|
||||
|
||||
|
||||
@cbook.deprecated("2.1", alternative="filecmp.cmp")
|
||||
--
|
||||
2.13.5
|
||||
|
||||
@@ -0,0 +1,142 @@
|
||||
From 279f95dae9dcd74d51c5913254889712697d1d8a Mon Sep 17 00:00:00 2001
|
||||
From: Elliott Sales de Andrade <quantum.analyst@gmail.com>
|
||||
Date: Fri, 6 Oct 2017 20:06:09 -0400
|
||||
Subject: [PATCH 2/8] TST: Capture all internal warnings.
|
||||
|
||||
These are either deprecations, or checks for old, but probably
|
||||
incorrect, behaviour.
|
||||
|
||||
Signed-off-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
|
||||
---
|
||||
lib/matplotlib/tests/test_axes.py | 10 ++++++++--
|
||||
lib/matplotlib/tests/test_cbook.py | 22 ++++++++++++----------
|
||||
lib/matplotlib/tests/test_colors.py | 10 +++++++++-
|
||||
lib/matplotlib/tests/test_dates.py | 5 ++++-
|
||||
lib/matplotlib/tests/test_image.py | 4 ++--
|
||||
5 files changed, 35 insertions(+), 16 deletions(-)
|
||||
|
||||
diff --git a/lib/matplotlib/tests/test_axes.py b/lib/matplotlib/tests/test_axes.py
|
||||
index 0c22740a4..273b6f4ec 100644
|
||||
--- a/lib/matplotlib/tests/test_axes.py
|
||||
+++ b/lib/matplotlib/tests/test_axes.py
|
||||
@@ -1677,13 +1677,19 @@ def test_as_mpl_axes_api():
|
||||
ax_via_gca = plt.gca(projection=prj)
|
||||
assert ax_via_gca is ax
|
||||
# try getting the axes given a different polar projection
|
||||
- ax_via_gca = plt.gca(projection=prj2)
|
||||
+ with pytest.warns(UserWarning) as rec:
|
||||
+ ax_via_gca = plt.gca(projection=prj2)
|
||||
+ assert len(rec) == 1
|
||||
+ assert 'Requested projection is different' in str(rec[0].message)
|
||||
assert ax_via_gca is not ax
|
||||
assert ax.get_theta_offset() == 0, ax.get_theta_offset()
|
||||
assert ax_via_gca.get_theta_offset() == np.pi, \
|
||||
ax_via_gca.get_theta_offset()
|
||||
# try getting the axes given an == (not is) polar projection
|
||||
- ax_via_gca = plt.gca(projection=prj3)
|
||||
+ with pytest.warns(UserWarning):
|
||||
+ ax_via_gca = plt.gca(projection=prj3)
|
||||
+ assert len(rec) == 1
|
||||
+ assert 'Requested projection is different' in str(rec[0].message)
|
||||
assert ax_via_gca is ax
|
||||
plt.close()
|
||||
|
||||
diff --git a/lib/matplotlib/tests/test_cbook.py b/lib/matplotlib/tests/test_cbook.py
|
||||
index f254b173c..4ff2cc52a 100644
|
||||
--- a/lib/matplotlib/tests/test_cbook.py
|
||||
+++ b/lib/matplotlib/tests/test_cbook.py
|
||||
@@ -29,16 +29,18 @@ def test_is_hashable():
|
||||
|
||||
def test_restrict_dict():
|
||||
d = {'foo': 'bar', 1: 2}
|
||||
- d1 = cbook.restrict_dict(d, ['foo', 1])
|
||||
- assert d1 == d
|
||||
- d2 = cbook.restrict_dict(d, ['bar', 2])
|
||||
- assert d2 == {}
|
||||
- d3 = cbook.restrict_dict(d, {'foo': 1})
|
||||
- assert d3 == {'foo': 'bar'}
|
||||
- d4 = cbook.restrict_dict(d, {})
|
||||
- assert d4 == {}
|
||||
- d5 = cbook.restrict_dict(d, {'foo', 2})
|
||||
- assert d5 == {'foo': 'bar'}
|
||||
+ with pytest.warns(cbook.deprecation.MatplotlibDeprecationWarning) as rec:
|
||||
+ d1 = cbook.restrict_dict(d, ['foo', 1])
|
||||
+ assert d1 == d
|
||||
+ d2 = cbook.restrict_dict(d, ['bar', 2])
|
||||
+ assert d2 == {}
|
||||
+ d3 = cbook.restrict_dict(d, {'foo': 1})
|
||||
+ assert d3 == {'foo': 'bar'}
|
||||
+ d4 = cbook.restrict_dict(d, {})
|
||||
+ assert d4 == {}
|
||||
+ d5 = cbook.restrict_dict(d, {'foo', 2})
|
||||
+ assert d5 == {'foo': 'bar'}
|
||||
+ assert len(rec) == 5
|
||||
# check that d was not modified
|
||||
assert d == {'foo': 'bar', 1: 2}
|
||||
|
||||
diff --git a/lib/matplotlib/tests/test_colors.py b/lib/matplotlib/tests/test_colors.py
|
||||
index 721813e62..82c73fe71 100644
|
||||
--- a/lib/matplotlib/tests/test_colors.py
|
||||
+++ b/lib/matplotlib/tests/test_colors.py
|
||||
@@ -690,7 +690,7 @@ def test_tableau_order():
|
||||
assert list(mcolors.TABLEAU_COLORS.values()) == dflt_cycle
|
||||
|
||||
|
||||
-def test_ndarray_subclass_norm():
|
||||
+def test_ndarray_subclass_norm(recwarn):
|
||||
# Emulate an ndarray subclass that handles units
|
||||
# which objects when adding or subtracting with other
|
||||
# arrays. See #6622 and #8696
|
||||
@@ -707,3 +707,11 @@ def test_ndarray_subclass_norm():
|
||||
mcolors.SymLogNorm(3, vmax=5, linscale=1),
|
||||
mcolors.PowerNorm(1)]:
|
||||
assert_array_equal(norm(data.view(MyArray)), norm(data))
|
||||
+ if isinstance(norm, mcolors.PowerNorm):
|
||||
+ assert len(recwarn) == 1
|
||||
+ warn = recwarn.pop(UserWarning)
|
||||
+ assert ('Power-law scaling on negative values is ill-defined'
|
||||
+ in str(warn.message))
|
||||
+ else:
|
||||
+ assert len(recwarn) == 0
|
||||
+ recwarn.clear()
|
||||
diff --git a/lib/matplotlib/tests/test_dates.py b/lib/matplotlib/tests/test_dates.py
|
||||
index 9f69d2ea7..437482f5f 100644
|
||||
--- a/lib/matplotlib/tests/test_dates.py
|
||||
+++ b/lib/matplotlib/tests/test_dates.py
|
||||
@@ -96,7 +96,10 @@ def test_too_many_date_ticks():
|
||||
tf = datetime.datetime(2000, 1, 20)
|
||||
fig = plt.figure()
|
||||
ax = fig.add_subplot(1, 1, 1)
|
||||
- ax.set_xlim((t0, tf), auto=True)
|
||||
+ with pytest.warns(UserWarning) as rec:
|
||||
+ ax.set_xlim((t0, tf), auto=True)
|
||||
+ assert len(rec) == 1
|
||||
+ assert 'Attempting to set identical left==right' in str(rec[0].message)
|
||||
ax.plot([], [])
|
||||
ax.xaxis.set_major_locator(mdates.DayLocator())
|
||||
with pytest.raises(RuntimeError):
|
||||
diff --git a/lib/matplotlib/tests/test_image.py b/lib/matplotlib/tests/test_image.py
|
||||
index 68a22894e..6240dd219 100644
|
||||
--- a/lib/matplotlib/tests/test_image.py
|
||||
+++ b/lib/matplotlib/tests/test_image.py
|
||||
@@ -603,7 +603,8 @@ def test_load_from_url():
|
||||
|
||||
@image_comparison(baseline_images=['log_scale_image'],
|
||||
remove_text=True)
|
||||
-def test_log_scale_image():
|
||||
+# The recwarn fixture captures a warning in image_comparison.
|
||||
+def test_log_scale_image(recwarn):
|
||||
Z = np.zeros((10, 10))
|
||||
Z[::2] = 1
|
||||
|
||||
@@ -615,7 +616,6 @@ def test_log_scale_image():
|
||||
ax.set_yscale('log')
|
||||
|
||||
|
||||
-
|
||||
@image_comparison(baseline_images=['rotate_image'],
|
||||
remove_text=True)
|
||||
def test_rotate_image():
|
||||
--
|
||||
2.13.5
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
From ee4253242cbaf972443ee49c59f056d8957f4f4f Mon Sep 17 00:00:00 2001
|
||||
From: Elliott Sales de Andrade <quantum.analyst@gmail.com>
|
||||
Date: Fri, 6 Oct 2017 20:53:16 -0400
|
||||
Subject: [PATCH 3/8] TST: Don't require LaTeX or Inkscape for nose tests.
|
||||
|
||||
Signed-off-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
|
||||
---
|
||||
lib/matplotlib/tests/test_compare_images.py | 4 ++++
|
||||
1 file changed, 4 insertions(+)
|
||||
|
||||
diff --git a/lib/matplotlib/tests/test_compare_images.py b/lib/matplotlib/tests/test_compare_images.py
|
||||
index 488fae823..f5bb9dda8 100644
|
||||
--- a/lib/matplotlib/tests/test_compare_images.py
|
||||
+++ b/lib/matplotlib/tests/test_compare_images.py
|
||||
@@ -203,6 +203,10 @@ def test_nose_image_comparison(func, kwargs, errors, failures, dots,
|
||||
assert failures[self.failure_count][1] in str(err[1])
|
||||
self.failure_count += 1
|
||||
|
||||
+ # Make sure that multiple extensions work, but don't require LaTeX or
|
||||
+ # Inkscape to do so.
|
||||
+ kwargs.setdefault('extensions', ['png', 'png', 'png'])
|
||||
+
|
||||
func = image_comparison(**kwargs)(func)
|
||||
loader = nose.loader.TestLoader()
|
||||
suite = loader.loadTestsFromGenerator(
|
||||
--
|
||||
2.13.5
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
From a95786dc8f982c8f7d212badad883754fe448c98 Mon Sep 17 00:00:00 2001
|
||||
From: Elliott Sales de Andrade <quantum.analyst@gmail.com>
|
||||
Date: Sat, 7 Oct 2017 00:28:59 -0400
|
||||
Subject: [PATCH 4/8] Fix AxesImage.get_cursor_data on arm.
|
||||
|
||||
For some reason, NaN gets converted to 0 as an integer instead of
|
||||
INT_MIN like on x86.
|
||||
|
||||
Fixes #6538.
|
||||
|
||||
Signed-off-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
|
||||
---
|
||||
lib/matplotlib/image.py | 5 ++++-
|
||||
1 file changed, 4 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/lib/matplotlib/image.py b/lib/matplotlib/image.py
|
||||
index ea2331cb4..52decc3ec 100644
|
||||
--- a/lib/matplotlib/image.py
|
||||
+++ b/lib/matplotlib/image.py
|
||||
@@ -822,7 +822,10 @@ class AxesImage(_ImageBase):
|
||||
array_extent = Bbox([[0, 0], arr.shape[:2]])
|
||||
trans = BboxTransform(boxin=data_extent, boxout=array_extent)
|
||||
y, x = event.ydata, event.xdata
|
||||
- i, j = trans.transform_point([y, x]).astype(int)
|
||||
+ point = trans.transform_point([y, x])
|
||||
+ if any(np.isnan(point)):
|
||||
+ return None
|
||||
+ i, j = point.astype(int)
|
||||
# Clip the coordinates at array bounds
|
||||
if not (0 <= i < arr.shape[0]) or not (0 <= j < arr.shape[1]):
|
||||
return None
|
||||
--
|
||||
2.13.5
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
From aaab55ffee458dc867f3f51e2a9908c6885b7dec Mon Sep 17 00:00:00 2001
|
||||
From: Elliott Sales de Andrade <quantum.analyst@gmail.com>
|
||||
Date: Sat, 7 Oct 2017 05:40:35 -0400
|
||||
Subject: [PATCH 5/8] TST: Use fuzzy comparison in test_psd_csd_equal.
|
||||
|
||||
Fixes #7158.
|
||||
|
||||
Signed-off-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
|
||||
---
|
||||
lib/matplotlib/tests/test_mlab.py | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/lib/matplotlib/tests/test_mlab.py b/lib/matplotlib/tests/test_mlab.py
|
||||
index 15047bdeb..ef36eaf0b 100644
|
||||
--- a/lib/matplotlib/tests/test_mlab.py
|
||||
+++ b/lib/matplotlib/tests/test_mlab.py
|
||||
@@ -7,7 +7,7 @@ import tempfile
|
||||
import warnings
|
||||
|
||||
from numpy.testing import (assert_allclose, assert_almost_equal,
|
||||
- assert_array_equal)
|
||||
+ assert_array_equal, assert_array_almost_equal_nulp)
|
||||
import numpy.ma.testutils as matest
|
||||
import numpy as np
|
||||
import datetime as datetime
|
||||
@@ -1985,7 +1985,7 @@ class TestSpectral(object):
|
||||
noverlap=self.nover_density,
|
||||
pad_to=self.pad_to_density,
|
||||
sides=self.sides)
|
||||
- assert_array_equal(Pxx, Pxy)
|
||||
+ assert_array_almost_equal_nulp(Pxx, Pxy)
|
||||
assert_array_equal(freqsxx, freqsxy)
|
||||
|
||||
def test_specgram_auto_default_equal(self):
|
||||
--
|
||||
2.13.5
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
From 5b1c238764a6f594991459f2c269e41157edba2f Mon Sep 17 00:00:00 2001
|
||||
From: Elliott Sales de Andrade <quantum.analyst@gmail.com>
|
||||
Date: Sun, 15 Oct 2017 17:16:11 -0400
|
||||
Subject: [PATCH 6/8] Use fuzzy comparison for stroke join determination.
|
||||
|
||||
This sometimes produces something just slightly different from 0
|
||||
compared to x86(_64).
|
||||
|
||||
Signed-off-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
|
||||
---
|
||||
extern/agg24-svn/include/agg_math_stroke.h | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/extern/agg24-svn/include/agg_math_stroke.h b/extern/agg24-svn/include/agg_math_stroke.h
|
||||
index 4806dcd4b..4871d96ce 100644
|
||||
--- a/extern/agg24-svn/include/agg_math_stroke.h
|
||||
+++ b/extern/agg24-svn/include/agg_math_stroke.h
|
||||
@@ -391,7 +391,8 @@ namespace agg
|
||||
vc.remove_all();
|
||||
|
||||
double cp = cross_product(v0.x, v0.y, v1.x, v1.y, v2.x, v2.y);
|
||||
- if(cp != 0 && (cp > 0) == (m_width > 0))
|
||||
+ if ((cp > agg::vertex_dist_epsilon && m_width > 0) ||
|
||||
+ (cp < -agg::vertex_dist_epsilon && m_width < 0))
|
||||
{
|
||||
// Inner join
|
||||
//---------------
|
||||
--
|
||||
2.13.5
|
||||
|
||||
@@ -1,5 +1,17 @@
|
||||
--- a/lib/matplotlib/__init__.py 2016-04-04 12:54:26.427194940 +0200
|
||||
+++ b/lib/matplotlib/__init__.py 2016-04-04 12:56:12.662590255 +0200
|
||||
From 400b97c30de5aa45e48a26c552dc310a3c1cf758 Mon Sep 17 00:00:00 2001
|
||||
From: Elliott Sales de Andrade <quantum.analyst@gmail.com>
|
||||
Date: Wed, 27 Sep 2017 19:35:59 -0400
|
||||
Subject: [PATCH 7/8] matplotlibrc path search fix
|
||||
|
||||
Signed-off-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
|
||||
---
|
||||
lib/matplotlib/__init__.py | 5 ++++-
|
||||
1 file changed, 4 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/lib/matplotlib/__init__.py b/lib/matplotlib/__init__.py
|
||||
index 00488a134..b989bc380 100644
|
||||
--- a/lib/matplotlib/__init__.py
|
||||
+++ b/lib/matplotlib/__init__.py
|
||||
@@ -635,9 +635,12 @@ def _get_data_path():
|
||||
|
||||
_file = _decode_filesystem_path(__file__)
|
||||
@@ -22,3 +34,6 @@
|
||||
|
||||
for fname in gen_candidates():
|
||||
if os.path.isfile(fname):
|
||||
--
|
||||
2.13.5
|
||||
|
||||
@@ -0,0 +1,128 @@
|
||||
From ce6e4fd43193698df2168fa946be479e5f8b96ff Mon Sep 17 00:00:00 2001
|
||||
From: Elliott Sales de Andrade <quantum.analyst@gmail.com>
|
||||
Date: Sun, 15 Oct 2017 17:35:47 -0400
|
||||
Subject: [PATCH 8/8] TST: Increase tolerances for FreeType 2.7.1.
|
||||
|
||||
Signed-off-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
|
||||
---
|
||||
lib/matplotlib/testing/decorators.py | 2 +-
|
||||
lib/matplotlib/tests/test_axes.py | 4 ++--
|
||||
lib/matplotlib/tests/test_mathtext.py | 4 ++--
|
||||
lib/matplotlib/tests/test_patches.py | 2 +-
|
||||
lib/matplotlib/tests/test_patheffects.py | 2 +-
|
||||
lib/matplotlib/tests/test_streamplot.py | 2 +-
|
||||
lib/mpl_toolkits/tests/test_mplot3d.py | 2 +-
|
||||
7 files changed, 9 insertions(+), 9 deletions(-)
|
||||
|
||||
diff --git a/lib/matplotlib/testing/decorators.py b/lib/matplotlib/testing/decorators.py
|
||||
index c5e069b31..ebd68cfab 100644
|
||||
--- a/lib/matplotlib/testing/decorators.py
|
||||
+++ b/lib/matplotlib/testing/decorators.py
|
||||
@@ -406,7 +406,7 @@ def _pytest_image_comparison(baseline_images, extensions, tol,
|
||||
return decorator
|
||||
|
||||
|
||||
-def image_comparison(baseline_images, extensions=None, tol=0,
|
||||
+def image_comparison(baseline_images, extensions=None, tol=0.1,
|
||||
freetype_version=None, remove_text=False,
|
||||
savefig_kwarg=None,
|
||||
# Default of mpl_test_settings fixture and cleanup too.
|
||||
diff --git a/lib/matplotlib/tests/test_axes.py b/lib/matplotlib/tests/test_axes.py
|
||||
index 273b6f4ec..4cf9cfa29 100644
|
||||
--- a/lib/matplotlib/tests/test_axes.py
|
||||
+++ b/lib/matplotlib/tests/test_axes.py
|
||||
@@ -672,7 +672,7 @@ def test_polar_rlabel_position():
|
||||
|
||||
|
||||
@image_comparison(baseline_images=['polar_theta_wedge'], style='default',
|
||||
- tol=0.01 if six.PY2 else 0)
|
||||
+ tol=0.1)
|
||||
def test_polar_theta_limits():
|
||||
r = np.arange(0, 3.0, 0.01)
|
||||
theta = 2*np.pi*r
|
||||
@@ -4641,7 +4641,7 @@ def test_rc_spines():
|
||||
|
||||
|
||||
@image_comparison(baseline_images=['rc_grid'], extensions=['png'],
|
||||
- savefig_kwarg={'dpi': 40})
|
||||
+ savefig_kwarg={'dpi': 40}, tol=0.2)
|
||||
def test_rc_grid():
|
||||
fig = plt.figure()
|
||||
rc_dict0 = {
|
||||
diff --git a/lib/matplotlib/tests/test_mathtext.py b/lib/matplotlib/tests/test_mathtext.py
|
||||
index 7ef77ce6a..b8c9c9e8b 100644
|
||||
--- a/lib/matplotlib/tests/test_mathtext.py
|
||||
+++ b/lib/matplotlib/tests/test_mathtext.py
|
||||
@@ -174,7 +174,7 @@ def baseline_images(request, fontset, index):
|
||||
['cm', 'stix', 'stixsans', 'dejavusans',
|
||||
'dejavuserif'])
|
||||
@pytest.mark.parametrize('baseline_images', ['mathtext'], indirect=True)
|
||||
-@image_comparison(baseline_images=None)
|
||||
+@image_comparison(baseline_images=None, tol=0.31)
|
||||
def test_mathtext_rendering(baseline_images, fontset, index, test):
|
||||
matplotlib.rcParams['mathtext.fontset'] = fontset
|
||||
fig = plt.figure(figsize=(5.25, 0.75))
|
||||
@@ -188,7 +188,7 @@ def test_mathtext_rendering(baseline_images, fontset, index, test):
|
||||
['cm', 'stix', 'stixsans', 'dejavusans',
|
||||
'dejavuserif'])
|
||||
@pytest.mark.parametrize('baseline_images', ['mathfont'], indirect=True)
|
||||
-@image_comparison(baseline_images=None, extensions=['png'])
|
||||
+@image_comparison(baseline_images=None, extensions=['png'], tol=0.3)
|
||||
def test_mathfont_rendering(baseline_images, fontset, index, test):
|
||||
matplotlib.rcParams['mathtext.fontset'] = fontset
|
||||
fig = plt.figure(figsize=(5.25, 0.75))
|
||||
diff --git a/lib/matplotlib/tests/test_patches.py b/lib/matplotlib/tests/test_patches.py
|
||||
index 20ffa6b08..9f5088f0f 100644
|
||||
--- a/lib/matplotlib/tests/test_patches.py
|
||||
+++ b/lib/matplotlib/tests/test_patches.py
|
||||
@@ -269,7 +269,7 @@ def test_wedge_movement():
|
||||
|
||||
# png needs tol>=0.06, pdf tol>=1.617
|
||||
@image_comparison(baseline_images=['wedge_range'],
|
||||
- remove_text=True, tol=1.65 if on_win else 0)
|
||||
+ remove_text=True, tol=0.1)
|
||||
def test_wedge_range():
|
||||
ax = plt.axes()
|
||||
|
||||
diff --git a/lib/matplotlib/tests/test_patheffects.py b/lib/matplotlib/tests/test_patheffects.py
|
||||
index 9b8a4379c..ebbcd6529 100644
|
||||
--- a/lib/matplotlib/tests/test_patheffects.py
|
||||
+++ b/lib/matplotlib/tests/test_patheffects.py
|
||||
@@ -125,7 +125,7 @@ def test_SimplePatchShadow_offset():
|
||||
assert pe._offset == (4, 5)
|
||||
|
||||
|
||||
-@image_comparison(baseline_images=['collection'], tol=0.015)
|
||||
+@image_comparison(baseline_images=['collection'], tol=0.1)
|
||||
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_streamplot.py b/lib/matplotlib/tests/test_streamplot.py
|
||||
index ac997b2b2..cd7233e2e 100644
|
||||
--- a/lib/matplotlib/tests/test_streamplot.py
|
||||
+++ b/lib/matplotlib/tests/test_streamplot.py
|
||||
@@ -36,7 +36,7 @@ def test_startpoints():
|
||||
|
||||
|
||||
@image_comparison(baseline_images=['streamplot_colormap'],
|
||||
- tol=0.002)
|
||||
+ tol=0.1)
|
||||
def test_colormap():
|
||||
X, Y, U, V = velocity_field()
|
||||
plt.streamplot(X, Y, U, V, color=U, density=0.6, linewidth=2,
|
||||
diff --git a/lib/mpl_toolkits/tests/test_mplot3d.py b/lib/mpl_toolkits/tests/test_mplot3d.py
|
||||
index c157433c7..c13f3be2f 100644
|
||||
--- a/lib/mpl_toolkits/tests/test_mplot3d.py
|
||||
+++ b/lib/mpl_toolkits/tests/test_mplot3d.py
|
||||
@@ -658,7 +658,7 @@ class TestVoxels(object):
|
||||
@image_comparison(
|
||||
baseline_images=['voxels-xyz'],
|
||||
extensions=['png'],
|
||||
- tol=0.01
|
||||
+ tol=0.02
|
||||
)
|
||||
def test_xyz(self):
|
||||
fig, ax = plt.subplots(subplot_kw={"projection": "3d"})
|
||||
--
|
||||
2.13.5
|
||||
|
||||
@@ -1,32 +0,0 @@
|
||||
diff -up matplotlib-1.5.1/lib/matplotlib/tests/test_image.py.tests matplotlib-1.5.1/lib/matplotlib/tests/test_image.py
|
||||
--- matplotlib-1.5.1/lib/matplotlib/tests/test_image.py.tests 2016-05-23 14:04:41.000000000 +0200
|
||||
+++ matplotlib-1.5.1/lib/matplotlib/tests/test_image.py 2016-06-02 00:28:37.076703843 +0200
|
||||
@@ -200,7 +200,8 @@ def test_cursor_data():
|
||||
|
||||
event = MouseEvent('motion_notify_event', fig.canvas, xdisp, ydisp)
|
||||
z = im.get_cursor_data(event)
|
||||
- assert z is None, "Did not get None, got %d" % z
|
||||
+ #0 instead of None on armv7hl
|
||||
+ #assert z is None, "Did not get None, got %d" % z
|
||||
|
||||
# Hmm, something is wrong here... I get 0, not None...
|
||||
# But, this works further down in the tests with extents flipped
|
||||
@@ -238,14 +239,16 @@ def test_cursor_data():
|
||||
|
||||
event = MouseEvent('motion_notify_event', fig.canvas, xdisp, ydisp)
|
||||
z = im.get_cursor_data(event)
|
||||
- assert z is None, "Did not get None, got %d" % z
|
||||
+ #0 instead of None on armv7hl
|
||||
+ #assert z is None, "Did not get None, got %d" % z
|
||||
|
||||
x, y = 0.01, -0.01
|
||||
xdisp, ydisp = ax.transData.transform_point([x, y])
|
||||
|
||||
event = MouseEvent('motion_notify_event', fig.canvas, xdisp, ydisp)
|
||||
z = im.get_cursor_data(event)
|
||||
- assert z is None, "Did not get None, got %d" % z
|
||||
+ #0 instead of None on armv7hl
|
||||
+ #assert z is None, "Did not get None, got %d" % z
|
||||
|
||||
|
||||
@image_comparison(baseline_images=['image_clip'], style='mpl20')
|
||||
@@ -1,53 +0,0 @@
|
||||
--- matplotlib-2.0.0rc2/lib/matplotlib/tests/test_axes.py 2016-12-18 11:40:53.000000000 -0800
|
||||
+++ matplotlib-2.0.0rc2/lib/matplotlib/tests/test_axes.py.new 2017-01-07 21:28:07.736224906 -0800
|
||||
@@ -1529,7 +1529,7 @@ def test_contour_colorbar():
|
||||
cbar.add_lines(cs2, erase=False)
|
||||
|
||||
|
||||
-@image_comparison(baseline_images=['hist2d', 'hist2d'])
|
||||
+@image_comparison(baseline_images=['hist2d', 'hist2d'], tol=10.677)
|
||||
def test_hist2d():
|
||||
np.random.seed(0)
|
||||
# make it not symmetric in case we switch x and y axis
|
||||
--- matplotlib-2.0.0rc2/lib/matplotlib/tests/test_mlab.py 2016-12-18 11:40:53.000000000 -0800
|
||||
+++ matplotlib-2.0.0rc2/lib/matplotlib/tests/test_mlab.py.new 2017-01-07 21:30:47.502916717 -0800
|
||||
@@ -1153,8 +1153,6 @@ class TestDetrend(object):
|
||||
'fstims,len_x,NFFT_density,nover_density,pad_to_density,pad_to_spectrum',
|
||||
[
|
||||
([], None, -1, -1, -1, -1),
|
||||
- ([4], None, -1, -1, -1, -1),
|
||||
- ([4, 5, 10], None, -1, -1, -1, -1),
|
||||
([], None, None, -1, -1, None),
|
||||
([], None, -1, -1, None, None),
|
||||
([], None, None, -1, None, None),
|
||||
@@ -1166,8 +1164,6 @@ class TestDetrend(object):
|
||||
],
|
||||
ids=[
|
||||
'nosig',
|
||||
- 'Fs4',
|
||||
- 'FsAll',
|
||||
'nosig_noNFFT',
|
||||
'nosig_nopad_to',
|
||||
'nosig_noNFFT_no_pad_to',
|
||||
--- matplotlib-2.0.0rc2/lib/matplotlib/tests/test_quiver.py 2016-12-18 11:40:53.000000000 -0800
|
||||
+++ matplotlib-2.0.0rc2/lib/matplotlib/tests/test_quiver.py.new 2017-01-07 21:29:53.441682625 -0800
|
||||
@@ -130,7 +130,7 @@ def test_quiver_key_pivot():
|
||||
ax.quiverkey(q, 0, 0.5, 1, 'W', labelpos='W')
|
||||
|
||||
|
||||
-@image_comparison(baseline_images=['barbs_test_image'],
|
||||
+@image_comparison(baseline_images=['barbs_test_image'], tol=0.8,
|
||||
extensions=['png'], remove_text=True)
|
||||
def test_barbs():
|
||||
x = np.linspace(-5, 5, 5)
|
||||
--- matplotlib-2.0.0rc2/lib/matplotlib/tests/test_transforms.py 2016-12-18 11:40:53.000000000 -0800
|
||||
+++ matplotlib-2.0.0rc2/lib/matplotlib/tests/test_transforms.py.new 2017-01-07 21:21:29.478503151 -0800
|
||||
@@ -75,7 +75,7 @@ def test_external_transform_api():
|
||||
|
||||
|
||||
@image_comparison(baseline_images=['pre_transform_data'],
|
||||
- tol=0.08)
|
||||
+ tol=0.9)
|
||||
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
|
||||
@@ -1,65 +0,0 @@
|
||||
--- matplotlib-2.0.0rc2/lib/matplotlib/tests/test_axes.py 2016-12-18 11:40:53.000000000 -0800
|
||||
+++ matplotlib-2.0.0rc2/lib/matplotlib/tests/test_axes.py.new 2017-01-07 21:35:06.874039829 -0800
|
||||
@@ -481,7 +481,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]
|
||||
@@ -5057,7 +5057,7 @@ def test_date_timezone_y():
|
||||
|
||||
|
||||
@image_comparison(baseline_images=['date_timezone_x_and_y'],
|
||||
- extensions=['png'])
|
||||
+ extensions=['png'], tol=3.042)
|
||||
def test_date_timezone_x_and_y():
|
||||
# Tests issue 5575
|
||||
time_index = [pytz.timezone('UTC').localize(datetime.datetime(
|
||||
--- matplotlib-2.0.0rc2/lib/matplotlib/tests/test_collections.py 2016-12-18 11:40:53.000000000 -0800
|
||||
+++ matplotlib-2.0.0rc2/lib/matplotlib/tests/test_collections.py.new 2017-01-07 21:35:52.016235301 -0800
|
||||
@@ -467,7 +467,7 @@ def test_EllipseCollection():
|
||||
ax.autoscale_view()
|
||||
|
||||
|
||||
-@image_comparison(baseline_images=['polycollection_close'],
|
||||
+@image_comparison(baseline_images=['polycollection_close'], tol=0.446,
|
||||
extensions=['png'], remove_text=True)
|
||||
def test_polycollection_close():
|
||||
from mpl_toolkits.mplot3d import Axes3D
|
||||
--- matplotlib-2.0.0rc2/lib/matplotlib/tests/test_contour.py 2016-12-18 11:40:53.000000000 -0800
|
||||
+++ matplotlib-2.0.0rc2/lib/matplotlib/tests/test_contour.py.new 2017-01-07 21:36:29.283396673 -0800
|
||||
@@ -234,7 +234,7 @@ def test_contour_datetime_axis():
|
||||
label.set_rotation(30)
|
||||
|
||||
|
||||
-@image_comparison(baseline_images=['contour_test_label_transforms'],
|
||||
+@image_comparison(baseline_images=['contour_test_label_transforms'], tol=0.731,
|
||||
extensions=['png'], remove_text=True)
|
||||
def test_labels():
|
||||
# Adapted from pylab_examples example code: contour_demo.py
|
||||
--- matplotlib-2.0.0rc2/lib/matplotlib/tests/test_transforms.py 2016-12-18 11:40:53.000000000 -0800
|
||||
+++ matplotlib-2.0.0rc2/lib/matplotlib/tests/test_transforms.py.new 2017-01-07 21:21:29.478503151 -0800
|
||||
@@ -75,7 +75,7 @@ def test_external_transform_api():
|
||||
|
||||
|
||||
@image_comparison(baseline_images=['pre_transform_data'],
|
||||
- tol=0.08)
|
||||
+ tol=0.15)
|
||||
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
|
||||
--- matplotlib-2.0.0rc2/lib/mpl_toolkits/tests/test_mplot3d.py 2016-12-18 11:40:53.000000000 -0800
|
||||
+++ matplotlib-2.0.0rc2/lib/mpl_toolkits/tests/test_mplot3d.py.new 2017-01-07 21:37:04.144547626 -0800
|
||||
@@ -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.081)
|
||||
def test_trisurf3d():
|
||||
n_angles = 36
|
||||
n_radii = 8
|
||||
|
||||
@@ -1,53 +0,0 @@
|
||||
--- matplotlib-2.0.0rc2/lib/matplotlib/testing/decorators.py 2016-12-18 11:40:53.000000000 -0800
|
||||
+++ matplotlib-2.0.0rc2/lib/matplotlib/testing/decorators.py.new 2017-01-07 21:19:51.078081193 -0800
|
||||
@@ -406,7 +406,7 @@ def _pytest_image_comparison(baseline_images, extensions, tol,
|
||||
return decorator
|
||||
|
||||
|
||||
-def image_comparison(baseline_images, extensions=None, tol=0,
|
||||
+def image_comparison(baseline_images, extensions=None, tol=0.306,
|
||||
freetype_version=None, remove_text=False,
|
||||
savefig_kwarg=None,
|
||||
# Default of mpl_test_settings fixture and cleanup too.
|
||||
--- matplotlib-2.0.0rc2/lib/matplotlib/tests/test_mathtext.py 2016-12-18 11:40:53.000000000 -0800
|
||||
+++ matplotlib-2.0.0rc2/lib/matplotlib/tests/test_mathtext.py.new 2017-01-07 22:02:42.396426402 -0800
|
||||
@@ -174,7 +174,7 @@ def baseline_images(request, fontset, index):
|
||||
['cm', 'stix', 'stixsans', 'dejavusans',
|
||||
'dejavuserif'])
|
||||
@pytest.mark.parametrize('baseline_images', ['mathtext'], indirect=True)
|
||||
-@image_comparison(baseline_images=None)
|
||||
+@image_comparison(baseline_images=None, tol=0.310)
|
||||
def test_mathtext_rendering(baseline_images, fontset, index, test):
|
||||
matplotlib.rcParams['mathtext.fontset'] = fontset
|
||||
fig = plt.figure(figsize=(5.25, 0.75))
|
||||
@@ -188,7 +188,7 @@ def test_mathtext_rendering(baseline_images, fontset, index, test):
|
||||
['cm', 'stix', 'stixsans', 'dejavusans',
|
||||
'dejavuserif'])
|
||||
@pytest.mark.parametrize('baseline_images', ['mathfont'], indirect=True)
|
||||
-@image_comparison(baseline_images=None, extensions=['png'])
|
||||
+@image_comparison(baseline_images=None, extensions=['png'], tol=0.310)
|
||||
def test_mathfont_rendering(baseline_images, fontset, index, test):
|
||||
matplotlib.rcParams['mathtext.fontset'] = fontset
|
||||
fig = plt.figure(figsize=(5.25, 0.75))
|
||||
--- matplotlib-2.0.0rc2/lib/matplotlib/tests/test_patheffects.py 2016-12-18 11:40:53.000000000 -0800
|
||||
+++ matplotlib-2.0.0rc2/lib/matplotlib/tests/test_patheffects.py.new 2017-01-07 21:21:08.014411109 -0800
|
||||
@@ -125,7 +125,7 @@ def test_SimplePatchShadow_offset():
|
||||
assert pe._offset == (4, 5)
|
||||
|
||||
|
||||
-@image_comparison(baseline_images=['collection'], tol=0.015)
|
||||
+@image_comparison(baseline_images=['collection'], tol=0.083)
|
||||
def test_collection():
|
||||
x, y = np.meshgrid(np.linspace(0, 10, 150), np.linspace(-5, 5, 100))
|
||||
data = np.sin(x) + np.cos(y)
|
||||
--- matplotlib-2.0.0rc2/lib/matplotlib/tests/test_streamplot.py 2016-12-18 11:40:53.000000000 -0800
|
||||
+++ matplotlib-2.0.0rc2/lib/matplotlib/tests/test_streamplot.py.new 2017-01-07 21:20:42.180300328 -0800
|
||||
@@ -36,7 +36,7 @@ def test_startpoints():
|
||||
|
||||
|
||||
@image_comparison(baseline_images=['streamplot_colormap'],
|
||||
- tol=0.002)
|
||||
+ tol=0.009)
|
||||
def test_colormap():
|
||||
X, Y, U, V = velocity_field()
|
||||
plt.streamplot(X, Y, U, V, color=U, density=0.6, linewidth=2,
|
||||
@@ -1,24 +0,0 @@
|
||||
diff -up matplotlib-1.5.2rc2/setupext.py.qh matplotlib-1.5.2rc2/setupext.py
|
||||
--- matplotlib-1.5.2rc2/setupext.py.qh 2016-06-04 00:09:22.605827942 +0200
|
||||
+++ matplotlib-1.5.2rc2/setupext.py 2016-06-04 00:09:22.611827972 +0200
|
||||
@@ -1018,7 +1018,7 @@ class Qhull(SetupPackage):
|
||||
# present on this system, so check if the header files can be
|
||||
# found.
|
||||
include_dirs = [
|
||||
- os.path.join(x, 'qhull') for x in get_include_dirs()]
|
||||
+ os.path.join(x, 'libqhull') for x in get_include_dirs()]
|
||||
if has_include_file(include_dirs, 'qhull_a.h'):
|
||||
return 'Using system Qhull (version unknown, no pkg-config info)'
|
||||
else:
|
||||
diff -up matplotlib-1.5.2rc2/src/qhull_wrap.c.qh matplotlib-1.5.2rc2/src/qhull_wrap.c
|
||||
--- matplotlib-1.5.2rc2/src/qhull_wrap.c.qh 2016-05-27 04:19:34.000000000 +0200
|
||||
+++ matplotlib-1.5.2rc2/src/qhull_wrap.c 2016-06-04 00:09:22.608827957 +0200
|
||||
@@ -7,7 +7,7 @@
|
||||
*/
|
||||
#include "Python.h"
|
||||
#include "numpy/noprefix.h"
|
||||
-#include "qhull/qhull_a.h"
|
||||
+#include <libqhull/qhull_a.h>
|
||||
#include <stdio.h>
|
||||
|
||||
|
||||
+16
-29
@@ -64,16 +64,17 @@ URL: http://matplotlib.org
|
||||
Source0: https://github.com/matplotlib/matplotlib/archive/v%{version}%{?rctag}.tar.gz#/matplotlib-%{version}%{?rctag}.tar.gz
|
||||
Source1: setup.cfg
|
||||
|
||||
Patch2: 20_matplotlibrc_path_search_fix.patch
|
||||
# https://github.com/matplotlib/matplotlib/issues/6538
|
||||
Patch8: python-matplotlib-disable-failing-tests-arm.patch
|
||||
# https://github.com/matplotlib/matplotlib/issues/7134
|
||||
# https://github.com/matplotlib/matplotlib/issues/7158
|
||||
# https://github.com/matplotlib/matplotlib/issues/7159
|
||||
# https://github.com/matplotlib/matplotlib/issues/7797
|
||||
Patch10: python-matplotlib-increase-tests-tolerance.patch
|
||||
Patch11: python-matplotlib-increase-tests-tolerance-aarch64ppc64.patch
|
||||
Patch13: python-matplotlib-increase-tests-tolerance-i686.patch
|
||||
# https://github.com/matplotlib/matplotlib/pull/9304
|
||||
Patch0001: 0001-TST-Skip-sphinxext-if-unavailable-instead-of-error.patch
|
||||
Patch0002: 0002-TST-Capture-all-internal-warnings.patch
|
||||
Patch0003: 0003-TST-Don-t-require-LaTeX-or-Inkscape-for-nose-tests.patch
|
||||
Patch0004: 0004-Fix-AxesImage.get_cursor_data-on-arm.patch
|
||||
Patch0005: 0005-TST-Use-fuzzy-comparison-in-test_psd_csd_equal.patch
|
||||
Patch0006: 0006-Use-fuzzy-comparison-for-stroke-join-determination.patch
|
||||
|
||||
# Fedora-specific patches.
|
||||
Patch1001: 0007-matplotlibrc-path-search-fix.patch
|
||||
Patch1002: 0008-TST-Increase-tolerances-for-FreeType-2.7.1.patch
|
||||
|
||||
BuildRequires: freetype-devel
|
||||
BuildRequires: libpng-devel
|
||||
@@ -102,7 +103,9 @@ BuildRequires: python-setuptools
|
||||
BuildRequires: python-six
|
||||
BuildRequires: python-subprocess32
|
||||
BuildRequires: python2-devel
|
||||
%if %{fedora} > 26
|
||||
BuildRequires: python2-backports
|
||||
%endif
|
||||
BuildRequires: python2-backports-functools_lru_cache
|
||||
BuildRequires: python2-pillow
|
||||
BuildRequires: pytz
|
||||
@@ -383,7 +386,7 @@ Requires: python3-tkinter
|
||||
%endif
|
||||
|
||||
%prep
|
||||
%setup -q -n matplotlib-%{version}%{?rctag}
|
||||
%autosetup -n matplotlib-%{version}%{?rctag} -p1
|
||||
rm -r extern/libqhull
|
||||
|
||||
# Copy setup.cfg to the builddir
|
||||
@@ -402,18 +405,6 @@ fi
|
||||
sed -i 's/\(USE_FONTCONFIG = \)False/\1True/' lib/matplotlib/font_manager.py
|
||||
%endif
|
||||
|
||||
%patch2 -p1
|
||||
%ifarch armv7hl aarch64
|
||||
%patch8 -p1 -b .tests-arm
|
||||
%endif
|
||||
|
||||
%patch10 -p1 -b .tests
|
||||
%ifarch aarch64 %{power64} s390 s390x
|
||||
%patch11 -p1 -b .tests-aarch64ppc64
|
||||
%endif
|
||||
%ifarch i686
|
||||
%patch13 -p1 -b .tests-i686
|
||||
%endif
|
||||
|
||||
%build
|
||||
export http_proxy=http://127.0.0.1/
|
||||
@@ -503,9 +494,7 @@ PYTHONPATH=%{buildroot}%{python3_sitearch} \
|
||||
|
||||
%files -n python2-matplotlib
|
||||
%license LICENSE/
|
||||
%doc CONTRIBUTING.md
|
||||
%doc CHANGELOG
|
||||
%doc README.rst
|
||||
%doc README.rst CONTRIBUTING.md
|
||||
%{python2_sitearch}/*egg-info
|
||||
%{python2_sitearch}/matplotlib-*-nspkg.pth
|
||||
%{python2_sitearch}/matplotlib/
|
||||
@@ -564,9 +553,7 @@ PYTHONPATH=%{buildroot}%{python3_sitearch} \
|
||||
%if %{with_python3}
|
||||
%files -n python3-matplotlib
|
||||
%license LICENSE/
|
||||
%doc CONTRIBUTING.md
|
||||
%doc CHANGELOG
|
||||
%doc README.rst
|
||||
%doc README.rst CONTRIBUTING.md
|
||||
%{python3_sitearch}/*egg-info
|
||||
%{python3_sitearch}/matplotlib-*-nspkg.pth
|
||||
%{python3_sitearch}/matplotlib/
|
||||
|
||||
Reference in New Issue
Block a user