civiqhub_selene.errors¶
Errors raised by SELENE. Standard library only.
Every error raised by civiqhub_selene derives from SeleneError and from
the standard exception a reader expects, so except ValueError catches an
InvalidInputError. Each class carries a hint: one sentence that says what
to do next. The hint is attached to the exception as a note, so it is printed under the
traceback, and str(error) stays the message alone.
A message names the faulty object and the value received; the hint names the remedy.
- exception civiqhub_selene.errors.ContractError(message, *, hint=None)[source]¶
Bases:
SeleneError,AssertionErrorAn estimator breaks the contract. Raised by the contract kit.
- Parameters:
message (str)
hint (str)
- Return type:
None
- exception civiqhub_selene.errors.EstimatorDefinitionError(message, *, hint=None)[source]¶
Bases:
SeleneError,TypeErrorAn estimator class does not declare its identity.
- Parameters:
message (str)
hint (str)
- Return type:
None
- exception civiqhub_selene.errors.InvalidInputError(message, *, hint=None)[source]¶
Bases:
SeleneError,ValueErrorThe data handed over is not what the method reads, or breaks an invariant.
- Parameters:
message (str)
hint (str)
- Return type:
None
- exception civiqhub_selene.errors.InvalidParameterError(message, *, hint=None)[source]¶
Bases:
SeleneError,ValueErrorA setting is outside its documented range.
- Parameters:
message (str)
hint (str)
- Return type:
None
- exception civiqhub_selene.errors.MissingExtraError(message, *, hint=None)[source]¶
Bases:
SeleneError,ImportErrorAn optional dependency is not installed.
- Parameters:
message (str)
hint (str)
- Return type:
None
- exception civiqhub_selene.errors.SeleneError(message, *, hint=None)[source]¶
Bases:
ExceptionRoot of every error raised by SELENE.
A subclass declares its own non-empty
hintin its class body; a subclass without one is refused when the class is defined.- Parameters:
message (str) – What went wrong, naming the faulty object and the value received.
hint (str) – What to do next. Defaults to the
hintof the class.
- Return type:
None
Bases:
SeleneError,LookupErrorThe value of a result that has none was read.
- Parameters:
message (str)
hint (str)
- Return type:
None
- exception civiqhub_selene.errors.UnknownEstimatorError(message, *, hint=None)[source]¶
Bases:
SeleneError,LookupErrorA registry key does not exist.
- Parameters:
message (str)
hint (str)
- Return type:
None