class AxisError(ValueError, IndexError):
def __init__(self, axis, ndim=None, msg_prefix=None):
self.axis = axis
self.ndim = ndim
if ndim is None:
msg = str(axis)
else:
msg = f"axis {axis} is out of bounds for array of dimension {ndim}"
if msg_prefix is not None:
msg = f"{msg_prefix}: {msg}"
super().__init__(msg)
class ComplexWarning(RuntimeWarning):
class RankWarning(UserWarning):
class TooHardError(RuntimeError):
class VisibleDeprecationWarning(UserWarning):
class DTypePromotionError(TypeError):
__all__ = [
"AxisError",
"ComplexWarning",
"RankWarning",
"TooHardError",
"VisibleDeprecationWarning",
"DTypePromotionError",
]