Skip to content

elicito.exceptions#

Exceptions that are used throughout

Classes:

Name Description
MissingOptionalDependencyError

Raised when an optional dependency is missing

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/elicito/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/elicito/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)