Errors¶
Every exception sekai raises on purpose derives from SekaiError, so
except sekai.SekaiError catches them all. They are exported from sekai and sekai.error,
and they pickle cleanly, so they survive the trip from a worker process (ProcVecEnv,
concurrent.futures.ProcessPoolExecutor, ...).
Argument validation (bad shapes, out-of-range parameters, wrong space types) raises the
built-in ValueError / TypeError instead.
| Exception | Raised when |
|---|---|
SekaiError |
base class |
EnvNotFound |
an ID is not registered (with close-match suggestions) |
EnvAlreadyRegistered |
an ID is registered twice |
InvalidAction |
an environment rejects an action (built-in envs raise it; use it in yours) |
ResetRequired |
step() (or a renderer) is used before reset() |
VecEnvWorkerError |
a ProcVecEnv worker raised or died (carries rank, exc_type, remote_traceback) |
VecEnvClosed |
a vector env is used after close() |
LookAheadError |
a feature transform used information from the future (raised by sekai.finance.features.check_causal) |
InvalidObservation, SpaceMismatch, AsyncCallPending |
not raised by sekai itself; available for your environments and tools |
BackendMismatch is deprecated together with sekai.backend and will be removed in sekai 0.3.
Nothing in sekai raises it; sekai.BackendMismatch and sekai.error.BackendMismatch still
work but emit a DeprecationWarning, and it is no longer in sekai.__all__.
SekaiError
¶
Bases: Exception
Base exception for all sekai errors.
Subclasses build their message from structured arguments, so the default exception pickling (which replays self.args, i.e. just the message) would fail. The constructor arguments are recorded instead, which keeps sekai errors picklable across processes (ProcVecEnv, ProcessPoolExecutor, ...).
EnvNotFound
¶
Bases: SekaiError
VecEnvWorkerError
¶
Bases: SekaiError
An exception raised inside a ProcVecEnv worker process.