scaffold.hydra.initialize

Functions

initialize(→ Iterator[hydra.core.global_hydra.GlobalHydra])

Context manager, that either uses an existing hydra instance, or initializes one temporarily.

Module Contents

scaffold.hydra.initialize.initialize(config_dir: str | None = None, job_name: str | None = 'app', exists_ok: bool | None = True) Iterator[hydra.core.global_hydra.GlobalHydra]

Context manager, that either uses an existing hydra instance, or initializes one temporarily.

Deprecated since version This: helper is no longer needed in most cases. Use hydra’s own hydra.initialize directly, or define configs with hydra_zen.builds() and hydra_zen.ZenStore which do not require manual initialization. This function will be removed in a future release.

Parameters:
  • config_dir (Optional[str]) – Absolute directory that should be added to the search path.

  • job_name (Optional[str]) – hydra.job.name which should be set.

  • exists_ok (Optional[bool]) – Do not fail if hydra is already initialized and yield GlobalHydra.instance().