From db9eea30b3190ddde3e03d890d905a9d471f7a5732bb2b4e0f8beb362a98e53f Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Mon, 25 Oct 2021 19:41:21 +0000 Subject: [PATCH] Accepting request 927122 from home:DocB:branches:devel:languages:python - version 3.4.3 Patches removed (in version 3.4.3): inkscape11.patch 0001-FIX-Pillow-asarray-bug.patch 0002-Dont-modify-arrays-when-masking-values-for-log.patch OBS-URL: https://build.opensuse.org/request/show/927122 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:numeric/python-matplotlib?expand=0&rev=55 --- 0001-FIX-Pillow-asarray-bug.patch | 22 ------ ...y-arrays-when-masking-values-for-log.patch | 71 ------------------- inkscape11.patch | 25 ------- matplotlib-3.4.2.tar.gz | 3 - matplotlib-3.4.3.tar.gz | 3 + python-matplotlib.changes | 9 +++ python-matplotlib.spec | 12 +--- 7 files changed, 14 insertions(+), 131 deletions(-) delete mode 100644 0001-FIX-Pillow-asarray-bug.patch delete mode 100644 0002-Dont-modify-arrays-when-masking-values-for-log.patch delete mode 100644 inkscape11.patch delete mode 100644 matplotlib-3.4.2.tar.gz create mode 100644 matplotlib-3.4.3.tar.gz diff --git a/0001-FIX-Pillow-asarray-bug.patch b/0001-FIX-Pillow-asarray-bug.patch deleted file mode 100644 index 8049ee4..0000000 --- a/0001-FIX-Pillow-asarray-bug.patch +++ /dev/null @@ -1,22 +0,0 @@ -From 5a4f6f035339d3573aa7b1a0ba67dfd4efb8f568 Mon Sep 17 00:00:00 2001 -From: Jody Klymak -Date: Thu, 1 Jul 2021 22:10:10 -0700 -Subject: [PATCH] FIX: PILLOW asarray bug - ---- - lib/matplotlib/image.py | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/lib/matplotlib/image.py b/lib/matplotlib/image.py -index a59499cd966..b2c9c4b22f9 100644 ---- a/lib/matplotlib/image.py -+++ b/lib/matplotlib/image.py -@@ -1688,7 +1688,7 @@ def _pil_png_to_float_array(pil_png): - mode = pil_png.mode - rawmode = pil_png.png.im_rawmode - if rawmode == "1": # Grayscale. -- return np.asarray(pil_png, np.float32) -+ return np.asarray(pil_png).astype(np.float32) - if rawmode == "L;2": # Grayscale. - return np.divide(pil_png, 2**2 - 1, dtype=np.float32) - if rawmode == "L;4": # Grayscale. diff --git a/0002-Dont-modify-arrays-when-masking-values-for-log.patch b/0002-Dont-modify-arrays-when-masking-values-for-log.patch deleted file mode 100644 index 4f5dd86..0000000 --- a/0002-Dont-modify-arrays-when-masking-values-for-log.patch +++ /dev/null @@ -1,71 +0,0 @@ -From 48eef460e8c861321e6d6a08a86ef0e45a863b59 Mon Sep 17 00:00:00 2001 -From: Elliott Sales de Andrade -Date: Thu, 24 Jun 2021 04:11:39 -0400 -Subject: [PATCH] Don't modify arrays when masking values for log. - -NumPy 1.21.0 fixed a bug with `np.ma.masked_where` where `copy=False` -now modifies the input if it is masked, which we do not want to do. -`np.ma.array` defaults to not copying the data, but copies the mask -(adding the new mask), which is what we wanted with `copy=False`. ---- - lib/matplotlib/colors.py | 4 ++-- - lib/matplotlib/tests/test_image.py | 28 ++++++++++++++++++++++++++++ - 2 files changed, 30 insertions(+), 2 deletions(-) - -diff --git a/lib/matplotlib/colors.py b/lib/matplotlib/colors.py -index e0c42c5b69d5..0f6bf35dc440 100644 ---- a/lib/matplotlib/colors.py -+++ b/lib/matplotlib/colors.py -@@ -1545,11 +1545,11 @@ class LogNorm(Normalize): - - def autoscale(self, A): - # docstring inherited. -- super().autoscale(np.ma.masked_less_equal(A, 0, copy=False)) -+ super().autoscale(np.ma.array(A, mask=(A <= 0))) - - def autoscale_None(self, A): - # docstring inherited. -- super().autoscale_None(np.ma.masked_less_equal(A, 0, copy=False)) -+ super().autoscale_None(np.ma.array(A, mask=(A <= 0))) - - - @_make_norm_from_scale( -diff --git a/lib/matplotlib/tests/test_image.py b/lib/matplotlib/tests/test_image.py -index 42ed7479ae54..0e385ba7a805 100644 ---- a/lib/matplotlib/tests/test_image.py -+++ b/lib/matplotlib/tests/test_image.py -@@ -1233,6 +1233,34 @@ def test_imshow_quantitynd(): - fig.canvas.draw() - - -+@check_figures_equal(extensions=['png']) -+def test_norm_change(fig_test, fig_ref): -+ # LogNorm should not mask anything invalid permanently. -+ data = np.full((5, 5), 1, dtype=np.float64) -+ data[0:2, :] = -1 -+ -+ masked_data = np.ma.array(data, mask=False) -+ masked_data.mask[0:2, 0:2] = True -+ -+ cmap = plt.get_cmap('viridis').with_extremes(under='w') -+ -+ ax = fig_test.subplots() -+ im = ax.imshow(data, norm=colors.LogNorm(vmin=0.5, vmax=1), -+ extent=(0, 5, 0, 5), interpolation='nearest', cmap=cmap) -+ im.set_norm(colors.Normalize(vmin=-2, vmax=2)) -+ im = ax.imshow(masked_data, norm=colors.LogNorm(vmin=0.5, vmax=1), -+ extent=(5, 10, 5, 10), interpolation='nearest', cmap=cmap) -+ im.set_norm(colors.Normalize(vmin=-2, vmax=2)) -+ ax.set(xlim=(0, 10), ylim=(0, 10)) -+ -+ ax = fig_ref.subplots() -+ ax.imshow(data, norm=colors.Normalize(vmin=-2, vmax=2), -+ extent=(0, 5, 0, 5), interpolation='nearest', cmap=cmap) -+ ax.imshow(masked_data, norm=colors.Normalize(vmin=-2, vmax=2), -+ extent=(5, 10, 5, 10), interpolation='nearest', cmap=cmap) -+ ax.set(xlim=(0, 10), ylim=(0, 10)) -+ -+ - @check_figures_equal(extensions=['png']) - def test_huge_range_log(fig_test, fig_ref): - data = np.full((5, 5), -1, dtype=np.float64) diff --git a/inkscape11.patch b/inkscape11.patch deleted file mode 100644 index 0bc737d..0000000 --- a/inkscape11.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 093fdeccef7e8195a31dfabfd4a4b5f1b07c96d5 Mon Sep 17 00:00:00 2001 -From: Elliott Sales de Andrade -Date: Wed, 21 Jul 2021 22:18:54 -0400 -Subject: [PATCH] Fix tests with Inkscape 1.1. - -The change is imperceptible, so just increase the tolerance. - -Fixes #20617. ---- - lib/matplotlib/tests/test_axes.py | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/lib/matplotlib/tests/test_axes.py b/lib/matplotlib/tests/test_axes.py -index 2211962cdf01..a885afe70c91 100644 ---- a/lib/matplotlib/tests/test_axes.py -+++ b/lib/matplotlib/tests/test_axes.py -@@ -1372,7 +1372,7 @@ def test_markevery_line(): - ax.legend() - - --@image_comparison(['markevery_linear_scales'], remove_text=True) -+@image_comparison(['markevery_linear_scales'], remove_text=True, tol=0.001) - def test_markevery_linear_scales(): - cases = [None, - 8, diff --git a/matplotlib-3.4.2.tar.gz b/matplotlib-3.4.2.tar.gz deleted file mode 100644 index 4952c1d..0000000 --- a/matplotlib-3.4.2.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:d8d994cefdff9aaba45166eb3de4f5211adb4accac85cbf97137e98f26ea0219 -size 37308683 diff --git a/matplotlib-3.4.3.tar.gz b/matplotlib-3.4.3.tar.gz new file mode 100644 index 0000000..8431eba --- /dev/null +++ b/matplotlib-3.4.3.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fc4f526dfdb31c9bd6b8ca06bf9fab663ca12f3ec9cdf4496fb44bc680140318 +size 37850796 diff --git a/python-matplotlib.changes b/python-matplotlib.changes index b615646..20b40db 100644 --- a/python-matplotlib.changes +++ b/python-matplotlib.changes @@ -1,3 +1,12 @@ +------------------------------------------------------------------- +Sat Oct 23 15:49:11 UTC 2021 - Axel Braun + +- version 3.4.3 + Patches removed (in version 3.4.3): + inkscape11.patch + 0001-FIX-Pillow-asarray-bug.patch + 0002-Dont-modify-arrays-when-masking-values-for-log.patch + ------------------------------------------------------------------- Tue Jul 27 12:09:25 UTC 2021 - Markéta Machová diff --git a/python-matplotlib.spec b/python-matplotlib.spec index 8c2ab9c..e01ffa1 100644 --- a/python-matplotlib.spec +++ b/python-matplotlib.spec @@ -31,7 +31,7 @@ ExclusiveArch: x86_64 aarch64 %bcond_with test %endif Name: python-matplotlib%{psuffix} -Version: 3.4.2 +Version: 3.4.3 Release: 0 Summary: Plotting Library for Python License: SUSE-Matplotlib @@ -41,12 +41,7 @@ Source1: matplotlib-setup.cfg # Bundled version of freetype and qhull for testing purposes only Source98: http://www.qhull.org/download/qhull-2020-src-8.0.2.tgz Source99: https://downloads.sourceforge.net/project/freetype/freetype2/2.6.1/freetype-2.6.1.tar.gz -# PATCH-FIX-UPSTREAM 0001-FIX-Pillow-asarray-bug.patch - Fix from upstream for an error related to asarray -Patch0: 0001-FIX-Pillow-asarray-bug.patch -# PATCH-FIX-UPSTREAM 0002-Dont-modify-arrays-when-masking-values-for-log.patch - Fix from upstream for numpy 1.21.0 -Patch1: 0002-Dont-modify-arrays-when-masking-values-for-log.patch -# PATCH-FIX-UPSTREAM https://github.com/matplotlib/matplotlib/commit/73b7abf14c77014ab2436e7691e19cbee5864f4b Fix tests with Inkscape 1.1. -Patch2: inkscape11.patch + BuildRequires: %{python_module Cycler >= 0.10} BuildRequires: %{python_module devel} BuildRequires: %{python_module kiwisolver >= 1.0.1} @@ -251,9 +246,6 @@ for %{name} plotting package %prep %setup -q -n matplotlib-%{version} -%patch0 -p1 -%patch1 -p1 -%patch2 -p1 #copy freetype to the right location, so that matplotlib will not try to download it mkdir -p ~/.cache/matplotlib/ SHA=($(sha256sum %{SOURCE98}))