make#
- statrl.experiments.utils.make(spec)[source]#
Instantiate an environment from a registry spec.
Imports the module named by the spec’s
entrypointfrom the file it sits next to and calls the class it names with the spec’skwargs. Loading by file path rather than by import name is what lets a setting’senvs/directory be a plain folder, with no package or installation.- Parameters:
spec (dict) – A registry entry as returned by
load(), with keysentrypoint("module:Class"),_base_dir, and optionallykwargsanddisplayname.- Returns:
The constructed environment, carrying a
displaynameattribute — the spec’s if given, otherwise itsname. That value becomes the title of the regret figures.- Return type:
- Raises:
ImportError – If the module named by the entrypoint cannot be loaded.
See also
loadReads the registry this spec comes from.