Add -matplotlib2 patch to fix test failures.

This commit is contained in:
Jerry James 2017-01-16 18:05:00 -07:00
parent c9a79828c3
commit 978bbc87d1
2 changed files with 29 additions and 0 deletions

20
sympy-matplotlib2.patch Normal file
View File

@ -0,0 +1,20 @@
--- sympy/plotting/plot.py.orig 2016-03-08 11:35:33.000000000 -0700
+++ sympy/plotting/plot.py 2017-01-16 17:27:38.093969621 -0700
@@ -383,7 +383,7 @@ class Line2DBaseSeries(BaseSeries):
np = import_module('numpy')
c = self.line_color
if hasattr(c, '__call__'):
- f = np.vectorize(c)
+ f = np.vectorize(c, [np.float64])
arity = len(getargspec(c)[0])
if arity == 1 and self.is_parametric:
x = self.get_parameter_points()
@@ -700,7 +700,7 @@ class SurfaceBaseSeries(BaseSeries):
np = import_module('numpy')
c = self.surface_color
if isinstance(c, Callable):
- f = np.vectorize(c)
+ f = np.vectorize(c, [np.float64])
arity = len(getargspec(c)[0])
if self.is_parametric:
variables = list(map(centers_of_faces, self.get_parameter_meshes()))

View File

@ -7,6 +7,8 @@ URL: http://sympy.org/
Source0: https://github.com/%{name}/%{name}/archive/%{name}-%{version}.tar.gz
# Fix two test failures with recent mpmath versions
Patch0: %{name}-test.patch
# Adapt to changes in matplotlib 2.x
Patch1: %{name}-matplotlib2.patch
BuildArch: noarch
BuildRequires: gcc-gfortran
@ -21,8 +23,10 @@ BuildRequires: python2-fastcache python3-fastcache
BuildRequires: python2-gmpy2 python3-gmpy2
BuildRequires: python2-matplotlib python3-matplotlib
BuildRequires: python-mpmath python3-mpmath
BuildRequires: python-pyglet python3-pyglet
BuildRequires: python2-scipy python3-scipy
BuildRequires: python2-sphinx
BuildRequires: python2-theano python3-theano
BuildRequires: tex(latex)
BuildRequires: tex-dvipng
BuildRequires: xorg-x11-fonts-Type1
@ -106,6 +110,11 @@ if [ "%{maxpyint}" = "7fffffff" ]; then
%{sympydir}/sympy/polys/tests/test_rootoftools.py
fi
# Fix a test failure
pushd %{sympydir}
%patch1
popd
# Make a copy for building the python3 version
cp -a %{sympydir} python3