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, AssertionError

An 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, TypeError

An 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, ValueError

The 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, ValueError

A 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, ImportError

An optional dependency is not installed.

Parameters:
  • message (str)

  • hint (str)

Return type:

None

exception civiqhub_selene.errors.SeleneError(message, *, hint=None)[source]

Bases: Exception

Root of every error raised by SELENE.

A subclass declares its own non-empty hint in 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 hint of the class.

Return type:

None

exception civiqhub_selene.errors.UnavailableError(message, *, hint=None)[source]

Bases: SeleneError, LookupError

The 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, LookupError

A registry key does not exist.

Parameters:
  • message (str)

  • hint (str)

Return type:

None