Source code for plotez.errors
"""Custom exceptions raised by PlotEZ."""
__all__ = [
"AxisLabelError",
"ColumnCountError",
"ConfigurationError",
"DataError",
"DataLengthError",
"EmptyDataError",
"OrientationError",
"PlotEZError",
"ShapeError",
"TwinXDataError",
"TwinYDataError",
"XArrayNot1D",
"YArrayNot1D",
]
[docs]
class PlotEZError(Exception):
"""Base class for exceptions related to plotting operations."""
[docs]
class OrientationError(PlotEZError):
"""Raised when an invalid or unexpected plot orientation is used."""
[docs]
class DataError(PlotEZError):
"""Base class for data-related plotting errors."""
[docs]
class ShapeError(DataError):
"""Raised when an array has an unexpected or incompatible shape."""
[docs]
class DataLengthError(DataError):
"""Raised when arrays that must align have incompatible lengths."""
[docs]
class EmptyDataError(DataError):
"""Raised when required primary x or y data is empty."""
[docs]
class ColumnCountError(DataError):
"""Raised when a data file does not contain exactly two columns."""
[docs]
class ConfigurationError(PlotEZError):
"""Base class for plot configuration and parameter errors."""
[docs]
class AxisLabelError(ConfigurationError):
"""Raised when ``axis_labels`` does not contain exactly three elements."""
[docs]
class TwinXDataError(ConfigurationError):
"""Raised when ``x2_data`` is supplied for a dual-Y-axis plot."""
[docs]
class TwinYDataError(ConfigurationError):
"""Raised when ``y2_data`` is supplied for a dual-X-axis plot."""
[docs]
class XArrayNot1D(ConfigurationError):
"""Raised when the x dimension of a data array is not one-dimensional."""
[docs]
class YArrayNot1D(ConfigurationError):
"""Raised when the y dimension of a data array is not one-dimensional."""