File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -697,10 +697,13 @@ def union(bboxes):
697
697
"""Return a `Bbox` that contains all of the given *bboxes*."""
698
698
if not len (bboxes ):
699
699
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 ])
704
707
return Bbox ([[x0 , y0 ], [x1 , y1 ]])
705
708
706
709
@staticmethod
You can’t perform that action at this time.
0 commit comments