Skip to content

Commit

Permalink
still key errors
Browse files Browse the repository at this point in the history
  • Loading branch information
peshence committed Sep 18, 2024
1 parent 50a6359 commit e0a33d0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions polytope/utility/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ class PolytopeError(Exception):
pass


class AxisOverdefinedError(PolytopeError):
class AxisOverdefinedError(PolytopeError, KeyError):
def __init__(self, axis):
self.axis = axis
self.message = (
Expand All @@ -11,19 +11,19 @@ def __init__(self, axis):
)


class AxisUnderdefinedError(PolytopeError):
class AxisUnderdefinedError(PolytopeError, KeyError):
def __init__(self, axis):
self.axis = axis
self.message = f"Axis {axis} is underdefined. It does not appear in any input polytope."


class AxisNotFoundError(PolytopeError):
class AxisNotFoundError(PolytopeError, KeyError):
def __init__(self, axis):
self.axis = axis
self.message = f"Axis {axis} does not exist in the datacube."


class UnsliceableShapeError(PolytopeError):
class UnsliceableShapeError(PolytopeError, KeyError):
def __init__(self, axis):
self.axis = axis
self.message = f"Higher-dimensional shape does not support unsliceable axis {axis.name}."

0 comments on commit e0a33d0

Please sign in to comment.