Structured Configs use Python dataclasses to describe your configuration structure and types. They enable:
- Runtime type checking as you compose or mutate your config
- Static type checking when using static type checkers (mypy, PyCharm, etc.)
- Primitive types (
- Nesting of Structured Configs
- Containers (List and Dict) containing primitives or Structured Configs
- Optional fields
Uniontypes are not supported (except
- User methods are not supported
- As a config, in place of configuration files (often a starting place)
- As a config schema validating configuration files (better for complex use cases)
With both patterns, you still get everything Hydra has to offer (config composition, Command line overrides etc). This tutorial covers both. *Read it in order*.
Hydra supports OmegaConf's Structured Configs via the
This tutorial does not assume any knowledge of them.
It is recommended that you visit the OmegaConf Structured Configs page to learn more later.
2. OmegaConf's Structured Configs are new.
Please report any issues.