1
0

Accepting request 998238 from devel:languages:python:numeric

- specfile:
  * removed pathc matplotlib-pr22975-fixarray.patch; included upstream
- update to version 3.5.3:
  * Fix alignment of over/under symbols
  * Fix bugs in colorbars:
    + alpha of extensions
    + drawedges=True with extensions
    + handling of panchor=False
  * Fix builds on Cygwin and IBM i
  * Fix contour labels in SubFigures
  * Fix cursor output:
    + for imshow with all negative values
    + when using BoundaryNorm
  * Fix interactivity in IPython/Jupyter
  * Fix NaN handling in errorbar
  * Fix NumPy conversion from AstroPy unit arrays
  * Fix positional markerfmt passed to stem
  * Fix unpickling:
    + crash loading in a separate process
    + incorrect DPI when HiDPI screens

OBS-URL: https://build.opensuse.org/request/show/998238
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-matplotlib?expand=0&rev=95
This commit is contained in:
Dominique Leuenberger 2022-08-22 09:04:50 +00:00 committed by Git OBS Bridge
commit 53e8fdc1b8
5 changed files with 30 additions and 77 deletions

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:48cf850ce14fa18067f2d9e0d646763681948487a8080ec0af2686468b4607a2
size 35210006

3
matplotlib-3.5.3.tar.gz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:339cac48b80ddbc8bfd05daae0a3a73414651a8596904c2a881cfd1edb65f26c
size 35236343

View File

@ -1,60 +0,0 @@
From 29ce2c226aafc170cb9b874e81b158c832322cf7 Mon Sep 17 00:00:00 2001
From: Jody Klymak <jklymak@gmail.com>
Date: Thu, 5 May 2022 04:38:49 +0000
Subject: [PATCH] FIX: fix check_1d to also check for ndim
Arrays sometimes don't have all the methods arrays should have, so
add another check here. Plot requires both ndim and shape and this
will extract the numpy array if x does not have those attributes.
Otherwise leave the object alone, because unit support (currently only
in plot) requires the object to retain the unit info.
---
lib/matplotlib/cbook/__init__.py | 7 ++++++-
lib/matplotlib/tests/test_units.py | 19 +++++++++++++++++++
2 files changed, 25 insertions(+), 1 deletion(-)
diff --git a/lib/matplotlib/cbook/__init__.py b/lib/matplotlib/cbook/__init__.py
index 774643fc9c99..5a955ed459c5 100644
--- a/lib/matplotlib/cbook/__init__.py
+++ b/lib/matplotlib/cbook/__init__.py
@@ -1333,7 +1333,12 @@ def _check_1d(x):
"""Convert scalars to 1D arrays; pass-through arrays as is."""
# Unpack in case of e.g. Pandas or xarray object
x = _unpack_to_numpy(x)
- if not hasattr(x, 'shape') or len(x.shape) < 1:
+ # plot requires `shape` and `ndim`. If passed an
+ # object that doesn't provide them, then force to numpy array.
+ # Note this will strip unit information.
+ if (not hasattr(x, 'shape') or
+ not hasattr(x, 'ndim') or
+ len(x.shape) < 1):
return np.atleast_1d(x)
else:
return x
diff --git a/lib/matplotlib/tests/test_units.py b/lib/matplotlib/tests/test_units.py
index 93a12cebb2c8..d3b8c5a71643 100644
--- a/lib/matplotlib/tests/test_units.py
+++ b/lib/matplotlib/tests/test_units.py
@@ -264,3 +264,22 @@ def test_empty_default_limits(quantity_converter):
fig.draw_without_rendering()
assert ax.get_ylim() == (0, 100)
assert ax.get_xlim() == (28.5, 31.5)
+
+
+# test array-like objects...
+class Kernel:
+ def __init__(self, array):
+ self._array = np.asanyarray(array)
+
+ def __array__(self):
+ return self._array
+
+ @property
+ def shape(self):
+ return self._array.shape
+
+
+def test_plot_kernel():
+ # just a smoketest that fail
+ kernel = Kernel([1, 2, 3, 4, 5])
+ plt.plot(kernel)

View File

@ -1,3 +1,28 @@
-------------------------------------------------------------------
Sun Aug 14 14:47:16 UTC 2022 - Arun Persaud <arun@gmx.de>
- specfile:
* removed pathc matplotlib-pr22975-fixarray.patch; included upstream
- update to version 3.5.3:
* Fix alignment of over/under symbols
* Fix bugs in colorbars:
+ alpha of extensions
+ drawedges=True with extensions
+ handling of panchor=False
* Fix builds on Cygwin and IBM i
* Fix contour labels in SubFigures
* Fix cursor output:
+ for imshow with all negative values
+ when using BoundaryNorm
* Fix interactivity in IPython/Jupyter
* Fix NaN handling in errorbar
* Fix NumPy conversion from AstroPy unit arrays
* Fix positional markerfmt passed to stem
* Fix unpickling:
+ crash loading in a separate process
+ incorrect DPI when HiDPI screens
------------------------------------------------------------------- -------------------------------------------------------------------
Thu May 26 16:23:46 UTC 2022 - Ben Greiner <code@bnavigator.de> Thu May 26 16:23:46 UTC 2022 - Ben Greiner <code@bnavigator.de>

View File

@ -31,7 +31,7 @@ ExclusiveArch: x86_64 aarch64
%bcond_with test %bcond_with test
%endif %endif
Name: python-matplotlib%{psuffix} Name: python-matplotlib%{psuffix}
Version: 3.5.2 Version: 3.5.3
Release: 0 Release: 0
Summary: Plotting Library for Python Summary: Plotting Library for Python
License: SUSE-Matplotlib License: SUSE-Matplotlib
@ -41,8 +41,6 @@ Source1: matplotlib-mplsetup.cfg
# Bundled version of freetype and qhull for testing purposes only # Bundled version of freetype and qhull for testing purposes only
Source98: http://www.qhull.org/download/qhull-2020-src-8.0.2.tgz 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 Source99: https://downloads.sourceforge.net/project/freetype/freetype2/2.6.1/freetype-2.6.1.tar.gz
# PATCH-FIX-UPSTREAM matplotlib-pr22975-fixarray.patch -- gh#matplotlib/matplotlib#22975, required for astropy 5.1
Patch1: https://github.com/matplotlib/matplotlib/pull/22975.patch#/matplotlib-pr22975-fixarray.patch
BuildRequires: %{python_module Cycler >= 0.10} BuildRequires: %{python_module Cycler >= 0.10}
BuildRequires: %{python_module FontTools >= 4.22.0} BuildRequires: %{python_module FontTools >= 4.22.0}
BuildRequires: %{python_module devel} BuildRequires: %{python_module devel}
@ -115,7 +113,6 @@ application servers, and six graphical user interface toolkits.
%package cairo %package cairo
Summary: Cairo backend for %{name} Summary: Cairo backend for %{name}
License: SUSE-Matplotlib
Requires: %{name} = %{version} Requires: %{name} = %{version}
Requires: python-cairo Requires: python-cairo
@ -125,7 +122,6 @@ for the %{name} plotting package
%package gtk3 %package gtk3
Summary: GTK3 backends for %{name} Summary: GTK3 backends for %{name}
License: SUSE-Matplotlib
Requires: %{name} = %{version} Requires: %{name} = %{version}
Requires: %{name}-gtk-common = %{version} Requires: %{name}-gtk-common = %{version}
@ -135,7 +131,6 @@ gtk3cairo backends for the %{name} plotting package
%package gtk4 %package gtk4
Summary: GTK4 backends for %{name} Summary: GTK4 backends for %{name}
License: SUSE-Matplotlib
Requires: %{name} = %{version} Requires: %{name} = %{version}
Requires: %{name}-gtk-common = %{version} Requires: %{name}-gtk-common = %{version}
@ -145,7 +140,6 @@ gtk4cairo backends for the %{name} plotting package
%package gtk-common %package gtk-common
Summary: code common for GTK3 and GTK4 backends for %{name} Summary: code common for GTK3 and GTK4 backends for %{name}
License: SUSE-Matplotlib
Requires: %{name} = %{version} Requires: %{name} = %{version}
Requires: %{name}-cairo = %{version} Requires: %{name}-cairo = %{version}
Requires: gdk-pixbuf-loader-rsvg Requires: gdk-pixbuf-loader-rsvg
@ -158,7 +152,6 @@ for the %{name} plotting package
%package latex %package latex
Summary: Allow rendering latex in %{name} Summary: Allow rendering latex in %{name}
License: SUSE-Matplotlib
Requires: %{name} = %{version} Requires: %{name} = %{version}
# grep usepackage lib/matplotlib/texmanager.py lib/matplotlib/backends/backend_pgf.py # grep usepackage lib/matplotlib/texmanager.py lib/matplotlib/backends/backend_pgf.py
# https://github.com/search?q=usepackage+repo%3Amatplotlib%2Fmatplotlib+path%3Alib&type=Code # https://github.com/search?q=usepackage+repo%3Amatplotlib%2Fmatplotlib+path%3Alib&type=Code
@ -194,7 +187,6 @@ and figures.
%package qt5 %package qt5
Summary: Qt5 backend for %{name} Summary: Qt5 backend for %{name}
License: SUSE-Matplotlib
Requires: %{name} = %{version} Requires: %{name} = %{version}
Requires: python-qt5 Requires: python-qt5
Provides: %{name}-qt-shared = %{version} Provides: %{name}-qt-shared = %{version}
@ -206,7 +198,6 @@ for the %{name} plotting package
%package testdata %package testdata
Summary: Test data for %{name} Summary: Test data for %{name}
License: SUSE-Matplotlib
Requires: %{name} = %{version} Requires: %{name} = %{version}
%description testdata %description testdata
@ -215,7 +206,6 @@ for the %{name} plotting package
%package tk %package tk
Summary: Tk backend for %{name} Summary: Tk backend for %{name}
License: SUSE-Matplotlib
Requires: %{name} = %{version} Requires: %{name} = %{version}
Requires: python-Pillow-tk Requires: python-Pillow-tk
Requires: python-tk Requires: python-tk
@ -227,7 +217,6 @@ for the %{name} plotting package
%package web %package web
Summary: Web backend for %{name} Summary: Web backend for %{name}
License: SUSE-Matplotlib
Requires: %{name} = %{version} Requires: %{name} = %{version}
Requires: python-tornado Requires: python-tornado
@ -237,7 +226,6 @@ for the %{name} plotting package
%package wx %package wx
Summary: WxWidgets backend for %{name} Summary: WxWidgets backend for %{name}
License: SUSE-Matplotlib
Requires: %{name} = %{version} Requires: %{name} = %{version}
Requires: python-wxPython >= 4 Requires: python-wxPython >= 4
@ -246,7 +234,7 @@ This package includes the wxWidgets-based wxagg backend
for %{name} plotting package for %{name} plotting package
%prep %prep
%autosetup -p1 -n matplotlib-%{version} %autosetup -n matplotlib-%{version}
#copy freetype to the right location, so that matplotlib will not try to download it #copy freetype to the right location, so that matplotlib will not try to download it
mkdir -p ~/.cache/matplotlib/ mkdir -p ~/.cache/matplotlib/
SHA=($(sha256sum %{SOURCE98})) SHA=($(sha256sum %{SOURCE98}))