mirror of
https://github.com/archlinuxarm/PKGBUILDs.git
synced 2024-11-18 22:54:00 +00:00
community/python2-matplotlib to 2.2.3-5
This commit is contained in:
parent
5bee4d16d1
commit
1391a127be
2 changed files with 362 additions and 6 deletions
|
@ -10,7 +10,7 @@
|
|||
|
||||
pkgname=python2-matplotlib
|
||||
pkgver=2.2.3
|
||||
pkgrel=4
|
||||
pkgrel=5
|
||||
pkgdesc="A python plotting library, making publication quality plots"
|
||||
arch=('x86_64')
|
||||
url="https://matplotlib.org"
|
||||
|
@ -43,7 +43,7 @@ source=($pkgname-$pkgver.tar.gz::"https://github.com/matplotlib/matplotlib/archi
|
|||
setup.cfg)
|
||||
sha512sums=('d118f5d56e2f578031aba22933c0b3a4423a31a04f50f08cc1aa660186546d09692a9cf401bb5f24cb296f94fbfd8707460728d501ac2bd4a624dfa89e92949b'
|
||||
'bb307885c17de71edf33dd09322aca99c2fade6dfbdf3482a7c11f2522fc40e2d41d8f51e77d2531de746906aabf3a68fa1bd8d76d48ea979c8010937713c0a9'
|
||||
'e63cd9b7a26de901815e3cdcc6a8e8f70e07bf9eed2befe4240747d245c96a4a44cc4b2fe876198b7bf055779c735d7571db2ca3904acdb1e4ddd288b3e24d2f'
|
||||
'88d71e85f707c9becc1d77812770889759b4dd96ec5c5fce20361c0c1a3fe1bd6e04ba804fcd7ff0472249ec8099ec63716184975b3d609aed84bfdd0a8e05ad'
|
||||
'f08c0b2e94599fdf2b736b8a655d862209934441d90f20ed872cfc128b8d2a6525763ab7cf64f2b3630e22a90798f4c52aa93b18087e9b48708d9bae34aada0b')
|
||||
|
||||
prepare() {
|
||||
|
|
|
@ -1,3 +1,50 @@
|
|||
diff --git a/lib/matplotlib/backends/backend_agg.py b/lib/matplotlib/backends/backend_agg.py
|
||||
index aff6cddf492..491a9b2c5d6 100644
|
||||
--- a/lib/matplotlib/backends/backend_agg.py
|
||||
+++ b/lib/matplotlib/backends/backend_agg.py
|
||||
@@ -391,7 +391,7 @@ def post_processing(image, dpi):
|
||||
self._update_methods()
|
||||
|
||||
if w > 0 and h > 0:
|
||||
- img = np.fromstring(buffer, np.uint8)
|
||||
+ img = np.frombuffer(buffer, np.uint8)
|
||||
img, ox, oy = post_processing(img.reshape((h, w, 4)) / 255.,
|
||||
self.dpi)
|
||||
gc = self.new_gc()
|
||||
diff --git a/lib/matplotlib/dates.py b/lib/matplotlib/dates.py
|
||||
index 2712d64291a..290341146d8 100644
|
||||
--- a/lib/matplotlib/dates.py
|
||||
+++ b/lib/matplotlib/dates.py
|
||||
@@ -1369,10 +1369,9 @@ def get_locator(self, dmin, dmax):
|
||||
else:
|
||||
locator = MicrosecondLocator(interval, tz=self.tz)
|
||||
if dmin.year > 20 and interval < 1000:
|
||||
- _log.warn('Plotting microsecond time intervals is not'
|
||||
- ' well supported. Please see the'
|
||||
- ' MicrosecondLocator documentation'
|
||||
- ' for details.')
|
||||
+ _log.warning('Plotting microsecond time intervals is not well '
|
||||
+ 'supported. Please see the MicrosecondLocator '
|
||||
+ 'documentation for details.')
|
||||
|
||||
locator.set_axis(self.axis)
|
||||
|
||||
diff --git a/lib/matplotlib/image.py b/lib/matplotlib/image.py
|
||||
index 58a28c8f689..3bdcccf4882 100644
|
||||
--- a/lib/matplotlib/image.py
|
||||
+++ b/lib/matplotlib/image.py
|
||||
@@ -1447,9 +1447,9 @@ def pil_to_array(pilImage):
|
||||
# return MxN luminance array of uint16
|
||||
raw = pilImage.tobytes('raw', pilImage.mode)
|
||||
if pilImage.mode.endswith('B'):
|
||||
- x = np.fromstring(raw, '>u2')
|
||||
+ x = np.frombuffer(raw, '>u2')
|
||||
else:
|
||||
- x = np.fromstring(raw, '<u2')
|
||||
+ x = np.frombuffer(raw, '<u2')
|
||||
return x.reshape(pilImage.size[::-1]).astype('=u2')
|
||||
else: # try to convert to an rgba image
|
||||
try:
|
||||
diff --git a/lib/matplotlib/testing/conftest.py b/lib/matplotlib/testing/conftest.py
|
||||
index 9dc180c9600..fb306594780 100644
|
||||
--- a/lib/matplotlib/testing/conftest.py
|
||||
|
@ -35,11 +82,104 @@ index 9dc180c9600..fb306594780 100644
|
|||
if baseline_images is None:
|
||||
# Allow baseline image list to be produced on the fly based on current
|
||||
# parametrization.
|
||||
diff --git a/lib/matplotlib/testing/decorators.py b/lib/matplotlib/testing/decorators.py
|
||||
index 0ce6e625249..d008446dcbf 100644
|
||||
--- a/lib/matplotlib/testing/decorators.py
|
||||
+++ b/lib/matplotlib/testing/decorators.py
|
||||
@@ -223,15 +223,25 @@ def _xfail_if_format_is_uncomparable(extension):
|
||||
|
||||
def _mark_xfail_if_format_is_uncomparable(extension):
|
||||
if isinstance(extension, six.string_types):
|
||||
- will_fail = extension not in comparable_formats()
|
||||
+ name = extension
|
||||
+ marks = []
|
||||
+ elif isinstance(extension, tuple):
|
||||
+ # Extension might be a pytest ParameterSet instead of a plain string.
|
||||
+ # Unfortunately, this type is not exposed, so since it's a namedtuple,
|
||||
+ # check for a tuple instead.
|
||||
+ name = extension.values[0]
|
||||
+ marks = list(extension.marks)
|
||||
else:
|
||||
# Extension might be a pytest marker instead of a plain string.
|
||||
- will_fail = extension.args[0] not in comparable_formats()
|
||||
- if will_fail:
|
||||
- fail_msg = 'Cannot compare %s files on this system' % extension
|
||||
+ name = extension.args[0]
|
||||
+ marks = [extension.mark]
|
||||
+
|
||||
+ if name not in comparable_formats():
|
||||
+ fail_msg = 'Cannot compare %s files on this system' % (name, )
|
||||
import pytest
|
||||
- return pytest.mark.xfail(extension, reason=fail_msg, strict=False,
|
||||
- raises=ImageComparisonFailure)
|
||||
+ marks += [pytest.mark.xfail(reason=fail_msg, strict=False,
|
||||
+ raises=ImageComparisonFailure)]
|
||||
+ return pytest.param(name, marks=marks)
|
||||
else:
|
||||
return extension
|
||||
|
||||
diff --git a/lib/matplotlib/tests/test_backend_pdf.py b/lib/matplotlib/tests/test_backend_pdf.py
|
||||
index 13fa0374ec7..c028eed8f2e 100644
|
||||
--- a/lib/matplotlib/tests/test_backend_pdf.py
|
||||
+++ b/lib/matplotlib/tests/test_backend_pdf.py
|
||||
@@ -8,6 +8,7 @@
|
||||
import os
|
||||
import sys
|
||||
import tempfile
|
||||
+import warnings
|
||||
|
||||
import numpy as np
|
||||
import pytest
|
||||
@@ -20,9 +21,11 @@
|
||||
_determinism_check)
|
||||
|
||||
|
||||
-needs_usetex = pytest.mark.xfail(
|
||||
- not checkdep_usetex(True),
|
||||
- reason="This test needs a TeX installation")
|
||||
+with warnings.catch_warnings():
|
||||
+ warnings.simplefilter('ignore')
|
||||
+ needs_usetex = pytest.mark.skipif(
|
||||
+ not checkdep_usetex(True),
|
||||
+ reason="This test needs a TeX installation")
|
||||
|
||||
|
||||
@image_comparison(baseline_images=['pdf_use14corefonts'],
|
||||
diff --git a/lib/matplotlib/tests/test_backend_ps.py b/lib/matplotlib/tests/test_backend_ps.py
|
||||
index 8bf6e7dde38..10d8033d4ca 100644
|
||||
index 8bf6e7dde38..46cb355c986 100644
|
||||
--- a/lib/matplotlib/tests/test_backend_ps.py
|
||||
+++ b/lib/matplotlib/tests/test_backend_ps.py
|
||||
@@ -31,13 +31,16 @@
|
||||
@@ -4,6 +4,7 @@
|
||||
|
||||
import io
|
||||
import re
|
||||
+import warnings
|
||||
|
||||
import numpy as np
|
||||
import pytest
|
||||
@@ -17,27 +18,30 @@
|
||||
_determinism_check)
|
||||
|
||||
|
||||
-needs_ghostscript = pytest.mark.xfail(
|
||||
- matplotlib.checkdep_ghostscript()[0] is None,
|
||||
- reason="This test needs a ghostscript installation")
|
||||
-
|
||||
-
|
||||
-needs_usetex = pytest.mark.xfail(
|
||||
- not matplotlib.checkdep_usetex(True),
|
||||
- reason="This test needs a TeX installation")
|
||||
+with warnings.catch_warnings():
|
||||
+ warnings.simplefilter('ignore')
|
||||
+ needs_ghostscript = pytest.mark.skipif(
|
||||
+ matplotlib.checkdep_ghostscript()[0] is None,
|
||||
+ reason="This test needs a ghostscript installation")
|
||||
+ needs_usetex = pytest.mark.skipif(
|
||||
+ not matplotlib.checkdep_usetex(True),
|
||||
+ reason="This test needs a TeX installation")
|
||||
|
||||
|
||||
# This tests tends to hit a TeX cache lock on AppVeyor.
|
||||
@pytest.mark.flaky(reruns=3)
|
||||
@pytest.mark.parametrize('format, use_log, rcParams', [
|
||||
('ps', False, {}),
|
||||
|
@ -61,11 +201,47 @@ index 8bf6e7dde38..10d8033d4ca 100644
|
|||
], ids=[
|
||||
'ps',
|
||||
'ps with distiller',
|
||||
diff --git a/lib/matplotlib/tests/test_backend_qt4.py b/lib/matplotlib/tests/test_backend_qt4.py
|
||||
index a621329772e..ede4bca9078 100644
|
||||
--- a/lib/matplotlib/tests/test_backend_qt4.py
|
||||
+++ b/lib/matplotlib/tests/test_backend_qt4.py
|
||||
@@ -29,7 +29,7 @@
|
||||
py_qt_ver = QtCore.__version_info__[0]
|
||||
|
||||
if py_qt_ver != 4:
|
||||
- pytestmark = pytest.mark.xfail(reason='Qt4 is not available')
|
||||
+ pytestmark = pytest.mark.skipif(reason='Qt4 is not available')
|
||||
|
||||
|
||||
@pytest.mark.backend('Qt4Agg')
|
||||
diff --git a/lib/matplotlib/tests/test_backend_svg.py b/lib/matplotlib/tests/test_backend_svg.py
|
||||
index e0cbdfa8bce..1f6bf7cc3a6 100644
|
||||
index e0cbdfa8bce..da93e2d3880 100644
|
||||
--- a/lib/matplotlib/tests/test_backend_svg.py
|
||||
+++ b/lib/matplotlib/tests/test_backend_svg.py
|
||||
@@ -130,7 +130,7 @@ def _test_determinism_save(filename, usetex):
|
||||
@@ -6,6 +6,7 @@
|
||||
from io import BytesIO
|
||||
import os
|
||||
import tempfile
|
||||
+import warnings
|
||||
import xml.parsers.expat
|
||||
|
||||
import pytest
|
||||
@@ -16,9 +17,11 @@
|
||||
from matplotlib import dviread
|
||||
|
||||
|
||||
-needs_usetex = pytest.mark.xfail(
|
||||
- not matplotlib.checkdep_usetex(True),
|
||||
- reason="This test needs a TeX installation")
|
||||
+with warnings.catch_warnings():
|
||||
+ warnings.simplefilter('ignore')
|
||||
+ needs_usetex = pytest.mark.skipif(
|
||||
+ not matplotlib.checkdep_usetex(True),
|
||||
+ reason="This test needs a TeX installation")
|
||||
|
||||
|
||||
def test_visibility():
|
||||
@@ -130,7 +133,7 @@ def _test_determinism_save(filename, usetex):
|
||||
"filename, usetex",
|
||||
# unique filenames to allow for parallel testing
|
||||
[("determinism_notex.svg", False),
|
||||
|
@ -91,3 +267,183 @@ index df7a5d08a10..8cd4585bffc 100644
|
|||
return backends
|
||||
|
||||
|
||||
diff --git a/lib/matplotlib/tests/test_image.py b/lib/matplotlib/tests/test_image.py
|
||||
index e6da25789f0..c8a23347f65 100644
|
||||
--- a/lib/matplotlib/tests/test_image.py
|
||||
+++ b/lib/matplotlib/tests/test_image.py
|
||||
@@ -23,14 +23,6 @@
|
||||
import pytest
|
||||
|
||||
|
||||
-try:
|
||||
- from PIL import Image
|
||||
- HAS_PIL = True
|
||||
-except ImportError:
|
||||
- HAS_PIL = False
|
||||
-needs_pillow = pytest.mark.xfail(not HAS_PIL, reason='Test requires Pillow')
|
||||
-
|
||||
-
|
||||
@image_comparison(baseline_images=['image_interps'], style='mpl20')
|
||||
def test_image_interps():
|
||||
'make the basic nearest, bilinear and bicubic interps'
|
||||
@@ -113,8 +105,8 @@ def test_image_python_io():
|
||||
plt.imread(buffer)
|
||||
|
||||
|
||||
-@needs_pillow
|
||||
def test_imread_pil_uint16():
|
||||
+ pytest.importorskip("PIL")
|
||||
img = plt.imread(os.path.join(os.path.dirname(__file__),
|
||||
'baseline_images', 'test_image', 'uint16.tif'))
|
||||
assert (img.dtype == np.uint16)
|
||||
@@ -122,8 +114,8 @@ def test_imread_pil_uint16():
|
||||
|
||||
|
||||
@pytest.mark.skipif(sys.version_info < (3, 6), reason="requires Python 3.6+")
|
||||
-@needs_pillow
|
||||
def test_imread_fspath():
|
||||
+ pytest.importorskip("PIL")
|
||||
from pathlib import Path
|
||||
img = plt.imread(
|
||||
Path(__file__).parent / 'baseline_images/test_image/uint16.tif')
|
||||
@@ -497,8 +489,8 @@ def test_nonuniformimage_setnorm():
|
||||
im.set_norm(plt.Normalize())
|
||||
|
||||
|
||||
-@needs_pillow
|
||||
def test_jpeg_2d():
|
||||
+ Image = pytest.importorskip('PIL.Image')
|
||||
# smoke test that mode-L pillow images work.
|
||||
imd = np.ones((10, 10), dtype='uint8')
|
||||
for i in range(10):
|
||||
@@ -509,8 +501,9 @@ def test_jpeg_2d():
|
||||
ax.imshow(im)
|
||||
|
||||
|
||||
-@needs_pillow
|
||||
def test_jpeg_alpha():
|
||||
+ Image = pytest.importorskip('PIL.Image')
|
||||
+
|
||||
plt.figure(figsize=(1, 1), dpi=300)
|
||||
# Create an image that is all black, with a gradient from 0-1 in
|
||||
# the alpha channel from left to right.
|
||||
diff --git a/lib/matplotlib/tests/test_mathtext.py b/lib/matplotlib/tests/test_mathtext.py
|
||||
index cdc1093e141..af6701a0f1d 100644
|
||||
--- a/lib/matplotlib/tests/test_mathtext.py
|
||||
+++ b/lib/matplotlib/tests/test_mathtext.py
|
||||
@@ -271,7 +271,7 @@ def test_single_minus_sign():
|
||||
|
||||
buff = io.BytesIO()
|
||||
plt.savefig(buff, format="rgba", dpi=1000)
|
||||
- array = np.fromstring(buff.getvalue(), dtype=np.uint8)
|
||||
+ array = np.frombuffer(buff.getvalue(), dtype=np.uint8)
|
||||
|
||||
# If this fails, it would be all white
|
||||
assert not np.all(array == 0xff)
|
||||
diff --git a/lib/matplotlib/tests/test_simplification.py b/lib/matplotlib/tests/test_simplification.py
|
||||
index fca140877bd..1b3ccb3f019 100644
|
||||
--- a/lib/matplotlib/tests/test_simplification.py
|
||||
+++ b/lib/matplotlib/tests/test_simplification.py
|
||||
@@ -273,7 +273,7 @@ def test_start_with_moveto():
|
||||
# Python 2 case
|
||||
decodebytes = base64.decodestring
|
||||
|
||||
- verts = np.fromstring(decodebytes(data), dtype='<i4')
|
||||
+ verts = np.frombuffer(decodebytes(data), dtype='<i4')
|
||||
verts = verts.reshape((len(verts) // 2, 2))
|
||||
path = Path(verts)
|
||||
segs = path.iter_segments(transforms.IdentityTransform(),
|
||||
diff --git a/lib/matplotlib/tests/test_text.py b/lib/matplotlib/tests/test_text.py
|
||||
index 7bc878accc9..e438766b703 100644
|
||||
--- a/lib/matplotlib/tests/test_text.py
|
||||
+++ b/lib/matplotlib/tests/test_text.py
|
||||
@@ -14,9 +14,11 @@
|
||||
from matplotlib.testing.decorators import image_comparison
|
||||
|
||||
|
||||
-needs_usetex = pytest.mark.xfail(
|
||||
- not matplotlib.checkdep_usetex(True),
|
||||
- reason="This test needs a TeX installation")
|
||||
+with warnings.catch_warnings():
|
||||
+ warnings.simplefilter('ignore')
|
||||
+ needs_usetex = pytest.mark.skipif(
|
||||
+ not matplotlib.checkdep_usetex(True),
|
||||
+ reason="This test needs a TeX installation")
|
||||
|
||||
|
||||
@image_comparison(baseline_images=['font_styles'])
|
||||
diff --git a/lib/matplotlib/tests/test_usetex.py b/lib/matplotlib/tests/test_usetex.py
|
||||
index 5d6a939e8a1..e3b1c1f6ce3 100644
|
||||
--- a/lib/matplotlib/tests/test_usetex.py
|
||||
+++ b/lib/matplotlib/tests/test_usetex.py
|
||||
@@ -1,4 +1,5 @@
|
||||
from __future__ import absolute_import, division, print_function
|
||||
+import warnings
|
||||
|
||||
import pytest
|
||||
|
||||
@@ -7,8 +8,14 @@
|
||||
import matplotlib.pyplot as plt
|
||||
|
||||
|
||||
-@pytest.mark.skipif(not matplotlib.checkdep_usetex(True),
|
||||
- reason='Missing TeX or Ghostscript or dvipng')
|
||||
+with warnings.catch_warnings():
|
||||
+ warnings.simplefilter('ignore')
|
||||
+ needs_usetex = pytest.mark.skipif(
|
||||
+ not matplotlib.checkdep_usetex(True),
|
||||
+ reason='Missing TeX of Ghostscript or dvipng')
|
||||
+
|
||||
+
|
||||
+@needs_usetex
|
||||
@image_comparison(baseline_images=['test_usetex'],
|
||||
extensions=['pdf', 'png'],
|
||||
tol=0.3)
|
||||
diff --git a/lib/matplotlib/tri/triinterpolate.py b/lib/matplotlib/tri/triinterpolate.py
|
||||
index e0c2047489a..f3c6deb0c97 100644
|
||||
--- a/lib/matplotlib/tri/triinterpolate.py
|
||||
+++ b/lib/matplotlib/tri/triinterpolate.py
|
||||
@@ -581,9 +581,9 @@ def _compute_tri_eccentricities(tris_pts):
|
||||
The so-called eccentricity parameters [1] needed for
|
||||
HCT triangular element.
|
||||
"""
|
||||
- a = np.expand_dims(tris_pts[:, 2, :]-tris_pts[:, 1, :], axis=2)
|
||||
- b = np.expand_dims(tris_pts[:, 0, :]-tris_pts[:, 2, :], axis=2)
|
||||
- c = np.expand_dims(tris_pts[:, 1, :]-tris_pts[:, 0, :], axis=2)
|
||||
+ a = np.expand_dims(tris_pts[:, 2, :] - tris_pts[:, 1, :], axis=2)
|
||||
+ b = np.expand_dims(tris_pts[:, 0, :] - tris_pts[:, 2, :], axis=2)
|
||||
+ c = np.expand_dims(tris_pts[:, 1, :] - tris_pts[:, 0, :], axis=2)
|
||||
# Do not use np.squeeze, this is dangerous if only one triangle
|
||||
# in the triangulation...
|
||||
dot_a = _prod_vectorized(_transpose_vectorized(a), a)[:, 0, 0]
|
||||
@@ -1071,9 +1071,9 @@ def get_dof_vec(tri_z, tri_dz, J):
|
||||
J1 = _prod_vectorized(_ReducedHCT_Element.J0_to_J1, J)
|
||||
J2 = _prod_vectorized(_ReducedHCT_Element.J0_to_J2, J)
|
||||
|
||||
- col0 = _prod_vectorized(J, np.expand_dims(tri_dz[:, 0, :], axis=3))
|
||||
- col1 = _prod_vectorized(J1, np.expand_dims(tri_dz[:, 1, :], axis=3))
|
||||
- col2 = _prod_vectorized(J2, np.expand_dims(tri_dz[:, 2, :], axis=3))
|
||||
+ col0 = _prod_vectorized(J, np.expand_dims(tri_dz[:, 0, :], axis=2))
|
||||
+ col1 = _prod_vectorized(J1, np.expand_dims(tri_dz[:, 1, :], axis=2))
|
||||
+ col2 = _prod_vectorized(J2, np.expand_dims(tri_dz[:, 2, :], axis=2))
|
||||
|
||||
dfdksi = _to_matrix_vectorized([
|
||||
[col0[:, 0, 0], col1[:, 0, 0], col2[:, 0, 0]],
|
||||
diff --git a/lib/mpl_toolkits/tests/test_mplot3d.py b/lib/mpl_toolkits/tests/test_mplot3d.py
|
||||
index 0a506db92ad..d6e57b9b4e6 100644
|
||||
--- a/lib/mpl_toolkits/tests/test_mplot3d.py
|
||||
+++ b/lib/mpl_toolkits/tests/test_mplot3d.py
|
||||
@@ -125,9 +125,10 @@ def test_lines3d():
|
||||
|
||||
|
||||
# Reason for flakiness of SVG test is still unknown.
|
||||
-@image_comparison(baseline_images=['mixedsubplot'], remove_text=True,
|
||||
- extensions=['png', 'pdf',
|
||||
- pytest.mark.xfail('svg', strict=False)])
|
||||
+@image_comparison(
|
||||
+ baseline_images=['mixedsubplot'], remove_text=True,
|
||||
+ extensions=['png', 'pdf',
|
||||
+ pytest.param('svg', marks=pytest.mark.xfail(strict=False))])
|
||||
def test_mixedsubplots():
|
||||
def f(t):
|
||||
s1 = np.cos(2*np.pi*t)
|
||||
|
|
Loading…
Reference in a new issue