diff --git a/masque/shapes/poly_collection.py b/masque/shapes/poly_collection.py index afa9c99..73aca30 100644 --- a/masque/shapes/poly_collection.py +++ b/masque/shapes/poly_collection.py @@ -56,6 +56,8 @@ class PolyCollection(Shape): """ Iterator which provides slices which index vertex_lists """ + if self._vertex_offsets.size == 0: + return for ii, ff in zip( self._vertex_offsets, chain(self._vertex_offsets, (self._vertex_lists.shape[0],)), @@ -168,7 +170,9 @@ class PolyCollection(Shape): annotations = copy.deepcopy(self.annotations), ) for vv in self.polygon_vertices] - def get_bounds_single(self) -> NDArray[numpy.float64]: # TODO note shape get_bounds doesn't include repetition + def get_bounds_single(self) -> NDArray[numpy.float64] | None: # TODO note shape get_bounds doesn't include repetition + if self._vertex_lists.size == 0: + return None return numpy.vstack((numpy.min(self._vertex_lists, axis=0), numpy.max(self._vertex_lists, axis=0)))