CultivarsError#
- exception cultivars.exceptions.CultivarsError[source]#
Bases:
ExceptionBase 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 fromnumpyorscipy) 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
DimensionError– the geometry of an input is wrong.SpecificationError– the content of a choice is wrong.NumericalError– the arithmetic could not be carried out.
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'>)