Skip to content

Commit

Permalink
BoundingBox.warp catches SpaceWarpingFailedError to throw `SpaceW…
Browse files Browse the repository at this point in the history
…arpingFailedError` not `ValueError`
  • Loading branch information
AhmetNSimsek committed Oct 25, 2024
1 parent 1e6020a commit f2caa19
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions siibra/locations/boundingbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,9 +297,10 @@ def warp(self, space):
return self
else:
try:
return self.corners.warp(spaceobj).boundingbox
except ValueError:
warped_corners = self.corners.warp(spaceobj)
except SpaceWarpingFailedError:
raise SpaceWarpingFailedError(f"Warping {str(self)} to {spaceobj.name} not successful.")
return warped_corners.boundingbox

def transform(self, affine: np.ndarray, space=None):
"""Returns a new bounding box obtained by transforming the
Expand Down

0 comments on commit f2caa19

Please sign in to comment.