10000 FIX: un-break nightly wheels on py37 · tacaswell/matplotlib@07533e1 · GitHub
[go: up one dir, main page]

Skip to content

Commit 07533e1

Browse files
committed
FIX: un-break nightly wheels on py37
The issue is that matplotlib#14131 made our test suite fail on any warnings (good!), however we do not test all versions of numpy and `np.min([np.nan])` seems to warn for 1.14.4 < version < 1.15.0 which is not a range we test on travis. However, the version of numpy that the wheels pin to for py37 in 1.14.6 which does warn. This is likely related to numpy/numpy#10370
1 parent 662bb8c commit 07533e1

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

lib/matplotlib/transforms.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -697,10 +697,13 @@ def union(bboxes):
697697
"""Return a `Bbox` that contains all of the given *bboxes*."""
698698
if not len(bboxes):
699699
raise ValueError("'bboxes' cannot be empty")
700-
x0 = np.min([bbox.xmin for bbox in bboxes])
701-
x1 = np.max([bbox.xmax for bbox in bboxes])
702-
y0 = np.min([bbox.ymin for bbox in bboxes])
703-
y1 = np.max([bbox.ymax for bbox in bboxes])
700+
# needed for 1.14.4 < numpy_version < 1.15
701+
# can remove once we are at numpy >= 1.15
702+
with np.errstate(invalid='ignore'):
703+
x0 = np.min([bbox.xmin for bbox in bboxes])
704+
x1 = np.max([bbox.xmax for bbox in bboxes])
705+
y0 = np.min([bbox.ymin for bbox in bboxes])
706+
y1 = np.max([bbox.ymax for bbox in bboxes])
704707
return Bbox([[x0, y0], [x1, y1]])
705708

706709
@staticmethod

0 commit comments

Comments
 (0)
0