wellcast.exceptions¶
exceptions ¶
Exception classes raised by wellcast.
Every exception derives from WellcastError, so callers can catch all
library errors with a single except clause. The concrete classes also
derive from the closest built-in exception (ValueError or
RuntimeError) so existing code that catches those keeps working.
WellcastError ¶
DataValidationError ¶
Bases: WellcastError, ValueError
Input data is missing, malformed or physically impossible.
Raised for example when a required column is absent, a rate is negative, or a water cut falls outside the closed interval [0, 1].
Examples:
FitError ¶
Bases: WellcastError, RuntimeError
A model or curve fit failed to converge or is not yet fitted.
Examples:
UnitError ¶
Bases: WellcastError, ValueError
A unit is unknown or two units measure different physical quantities.
Examples:
MissingDependencyError ¶
Bases: WellcastError, ImportError
An optional dependency needed by the requested feature is not installed.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
package
|
str
|
Name of the missing import, for example |
required |
extra
|
str
|
Name of the wellcast extra that provides it, for example |
required |
Examples:
>>> from wellcast.exceptions import MissingDependencyError
>>> print(MissingDependencyError("lightgbm", "ml"))
lightgbm is required for this feature.
Install the ml extra: pip install 'wellcast[ml]'