gcages.exceptions#
Exceptions that are used throughout
Classes:
| Name | Description |
|---|---|
MissingOptionalDependencyError |
Raised when an optional dependency is missing |
UnrecognisedValueError |
Raised when a value is not recognised |
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/gcages/exceptions.py
__init__ #
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/gcages/exceptions.py
UnrecognisedValueError #
Bases: ValueError
Raised when a value is not recognised
In this context, recognised means 'known' in the sense of being part of some set of values that are understood and defined. For example, this error could be raised when a value is not be part of a set of a controlled vocabulary/known definitions.
Methods:
| Name | Description |
|---|---|
__init__ |
Initialise the error |
Source code in src/gcages/exceptions.py
__init__ #
__init__(
unrecognised_value: Any,
name: Any,
known_values: Collection[Any],
) -> None
Initialise the error
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
unrecognised_value
|
Any
|
The unrecognised value |
required |
name
|
Any
|
The name of the thing that has the unrecognised value For example, |
required |
known_values
|
Collection[Any]
|
The known values for |
required |