Skip to content

continuous_timeseries.exceptions#

Exceptions that are used throughout

Classes:

Name Description
ExtrapolationNotAllowedError

Raised when extrapolation is attempted, but isn't allowed

MissingOptionalDependencyError

Raised when an optional dependency is missing

ExtrapolationNotAllowedError #

Bases: ValueError

Raised when extrapolation is attempted, but isn't allowed

Methods:

Name Description
__init__

Initialise the error

Source code in src/continuous_timeseries/exceptions.py
class ExtrapolationNotAllowedError(ValueError):
    """
    Raised when extrapolation is attempted, but isn't allowed
    """

    def __init__(self, msg: str) -> None:
        """
        Initialise the error

        Parameters
        ----------
        msg
            The message to display
        """
        super().__init__(msg)

__init__ #

__init__(msg: str) -> None

Initialise the error

Parameters:

Name Type Description Default
msg str

The message to display

required
Source code in src/continuous_timeseries/exceptions.py
def __init__(self, msg: str) -> None:
    """
    Initialise the error

    Parameters
    ----------
    msg
        The message to display
    """
    super().__init__(msg)

MissingOptionalDependencyError #

Bases: ImportError

Raised when an optional dependency is missing

For example, plotting dependencies like matplotlib

Methods:

Name Description
__init__

Initialise the error

Source code in src/continuous_timeseries/exceptions.py
class MissingOptionalDependencyError(ImportError):
    """
    Raised when an optional dependency is missing

    For example, plotting dependencies like matplotlib
    """

    def __init__(self, callable_name: str, requirement: str) -> None:
        """
        Initialise the error

        Parameters
        ----------
        callable_name
            The name of the callable that requires the dependency

        requirement
            The name of the requirement
        """
        error_msg = f"`{callable_name}` requires {requirement} to be installed"
        super().__init__(error_msg)

__init__ #

__init__(callable_name: str, requirement: str) -> None

Initialise the error

Parameters:

Name Type Description Default
callable_name str

The name of the callable that requires the dependency

required
requirement str

The name of the requirement

required
Source code in src/continuous_timeseries/exceptions.py
def __init__(self, callable_name: str, requirement: str) -> None:
    """
    Initialise the error

    Parameters
    ----------
    callable_name
        The name of the callable that requires the dependency

    requirement
        The name of the requirement
    """
    error_msg = f"`{callable_name}` requires {requirement} to be installed"
    super().__init__(error_msg)