Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

create base polytope error #213

Merged
merged 3 commits into from
Sep 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions polytope/utility/exceptions.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
class AxisOverdefinedError(KeyError):
class PolytopeError(Exception):
pass


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


class AxisUnderdefinedError(KeyError):
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(KeyError):
class AxisNotFoundError(PolytopeError, KeyError):
def __init__(self, axis):
self.axis = axis
self.message = f"Axis {axis} does not exist in the datacube."


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