unilab.base.env_factory¶
Picklable EnvFactory adapters bridging the RL env contract to the
UniLab env registry.
RL runners and collectors (unilab.rl) never construct environments
themselves; the caller injects an EnvFactory (see
unilab.rl.contracts.env). Because collectors run in multiprocessing
spawn subprocesses, the factory must be picklable by reference — the adapters
below are module-level functions bound with functools.partial (never
closures or lambdas).
Functions
|
|
|
Bind a registry task/backend pair into a picklable |
- unilab.base.env_factory.make_registry_env(task_name, sim_backend, num_envs, env_cfg_override=None)[source]¶
EnvFactoryimplementation backed by the UniLab env registry.Top-level on purpose:
functools.partialbindings of this function stay picklable for spawn-based collector subprocesses.ensure_registriesruns here because a spawned subprocess is a fresh interpreter that never executed the parent process’s registry bootstrap.