From e8d9ea33f1ba1a2c1da10fb0f2afaea0340c9f98 Mon Sep 17 00:00:00 2001 From: Antony Lee Date: Thu, 11 Feb 2021 19:49:59 +0100 Subject: [PATCH 1/3] Remove workaround for numpy<1.16, and update version check. We now require numpy 1.16 (per setup.py and NEP29). --- lib/matplotlib/__init__.py | 2 +- lib/matplotlib/transforms.py | 11 ++++------- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/lib/matplotlib/__init__.py b/lib/matplotlib/__init__.py index 5d3dfc95e048..97c1fbbb5cea 100644 --- a/lib/matplotlib/__init__.py +++ b/lib/matplotlib/__init__.py @@ -145,7 +145,7 @@ def _check_versions(): ("cycler", "0.10"), ("dateutil", "2.1"), ("kiwisolver", "1.0.1"), - ("numpy", "1.15"), + ("numpy", "1.16"), ("pyparsing", "2.0.1"), ]: module = importlib.import_module(modname) diff --git a/lib/matplotlib/transforms.py b/lib/matplotlib/transforms.py index 688b27f93727..9a50e4bf0048 100644 --- a/lib/matplotlib/transforms.py +++ b/lib/matplotlib/transforms.py @@ -677,13 +677,10 @@ def union(bboxes): """Return a `Bbox` that contains all of the given *bboxes*.""" if not len(bboxes): raise ValueError("'bboxes' cannot be empty") - # needed for 1.14.4 < numpy_version < 1.16 - # can remove once we are at numpy >= 1.16 - with np.errstate(invalid='ignore'): - x0 = np.min([bbox.xmin for bbox in bboxes]) - x1 = np.max([bbox.xmax for bbox in bboxes]) - y0 = np.min([bbox.ymin for bbox in bboxes]) - y1 = np.max([bbox.ymax for bbox in bboxes]) + x0 = np.min([bbox.xmin for bbox in bboxes]) + x1 = np.max([bbox.xmax for bbox in bboxes]) + y0 = np.min([bbox.ymin for bbox in bboxes]) + y1 = np.max([bbox.ymax for bbox in bboxes]) return Bbox([[x0, y0], [x1, y1]]) @staticmethod From 6b2a3f43212846b3242ee34df395a4d403717b89 Mon Sep 17 00:00:00 2001 From: Thomas A Caswell Date: Mon, 15 Feb 2021 20:39:36 -0500 Subject: [PATCH 2/3] DOC: Note numpy version bump to 1.16 --- doc/api/next_api_changes/development/19500-AL.rst | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 doc/api/next_api_changes/development/19500-AL.rst diff --git a/doc/api/next_api_changes/development/19500-AL.rst b/doc/api/next_api_changes/development/19500-AL.rst new file mode 100644 index 000000000000..677287905f25 --- /dev/null +++ b/doc/api/next_api_changes/development/19500-AL.rst @@ -0,0 +1,2 @@ +Matplotlib now requires numpy>=1.16 +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ From 7558cabeb54298ee89f1de74bec9ce7fe778c8b8 Mon Sep 17 00:00:00 2001 From: Thomas A Caswell Date: Mon, 15 Feb 2021 20:48:54 -0500 Subject: [PATCH 3/3] MNT: also bump run-time checking of pyparsing and dateutil --- lib/matplotlib/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/matplotlib/__init__.py b/lib/matplotlib/__init__.py index 97c1fbbb5cea..401e33895c6f 100644 --- a/lib/matplotlib/__init__.py +++ b/lib/matplotlib/__init__.py @@ -143,10 +143,10 @@ def _check_versions(): for modname, minver in [ ("cycler", "0.10"), - ("dateutil", "2.1"), + ("dateutil", "2.7"), ("kiwisolver", "1.0.1"), ("numpy", "1.16"), - ("pyparsing", "2.0.1"), + ("pyparsing", "2.2.1"), ]: module = importlib.import_module(modname) if LooseVersion(module.__version__) < minver: