CultivarsError#

exception cultivars.exceptions.CultivarsError[source]#

Bases: Exception

Base class for every exception raised by cultivars.

Catch this to handle any failure the package itself detects – a malformed input, an inconsistent specification, a computation that cannot proceed – while letting genuine bugs (AssertionError, NotImplementedError, library errors escaping from numpy or scipy) propagate. Never raised directly; every raise site uses one of the three subclasses, each of which also derives from the builtin that matches its failure mode.

See also

Example

>>> import numpy as np
>>> from cultivars.univariate.box_jenkins import ARIMA
>>> try:
...     ARIMA(np.arange(50.0), order=(1, 0, 0), trend="quadratic")
... except CultivarsError as error:
...     print(type(error).__name__)
SpecificationError
>>> CultivarsError.__mro__[1:3]
(<class 'Exception'>, <class 'BaseException'>)