neurodocker.reproenv.state module

Stateful objects in reproenv runtime.

neurodocker.reproenv.state.get_template(name: str)neurodocker.reproenv.types.TemplateType

Return a Template object from the registry given a template name.

Parameters
  • name (str) – The name of the registered template.

  • the template is not found (If) –

  • it was not added to the registry using (perhaps) –

  • register.

neurodocker.reproenv.state.register_template(path_or_template: Union[str, os.PathLike, neurodocker.reproenv.types.TemplateType], name: Optional[str] = None)neurodocker.reproenv.types.TemplateType

Register a template. This will overwrite an existing template with the same name in the registry.

The template is validated against reproenv’s template JSON schema upon registration. An invalid template will raise an exception.

Parameters
  • path_or_template (str, Path-like, or TemplateType) – Path to YAML file that defines the template, or the dictionary that represents the template.

  • name (str) – Name of the template. This becomes the key to the template in the registry. The name is made lower-case. If path_or_template is a path, then name can be omitted and instead comes from template[“name”]. If path_or_template is a dict, then name is required.

neurodocker.reproenv.state.registered_templates()KeysView[str]

Return names of registered templates.

neurodocker.reproenv.state.registered_templates_items()ItemsView[str, neurodocker.reproenv.types.TemplateType]