neurodocker.reproenv.state module#

Stateful objects in reproenv runtime.

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

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

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

  • found (If the template is not) –

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

  • register.

neurodocker.reproenv.state.register_template(path_or_template: str | PathLike | TemplateType, name: str | None = None) 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, TemplateType]#