unilab.base.env_factory¶
Picklable EnvFactory adapters bridging uni_rl’s injected env contract
to the UniLab env registry.
uni_rl runners and collectors never construct environments themselves; the
caller injects an EnvFactory (see uni_rl.env_contract). 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.