Skip to content

Remove workaround for numpy<1.16, and update version check. #19500

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Feb 16, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions doc/api/next_api_changes/development/19500-AL.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Matplotlib now requires numpy>=1.16
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
6 changes: 3 additions & 3 deletions lib/matplotlib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.15"),
("pyparsing", "2.0.1"),
("numpy", "1.16"),
("pyparsing", "2.2.1"),
]:
module = importlib.import_module(modname)
if LooseVersion(module.__version__) < minver:
Expand Down
11 changes: 4 additions & 7 deletions lib/matplotlib/transforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down