Index
Hydra is a powerful configuration framework for Python applications, focused on modularity.
The generic config layout consists of multiple groups, each containing multiple options, and a root config, composing the resulting config object by choosing one option in each group:
conf/
group1/
option1.yaml
option2.yaml
group2/
option1.yaml
option2.yaml
config.yaml
Example:
group1:
field1: value1
field2: value2
group2:
key: "option one in group two"
python3 main.py
defaults:
- group1: option2
- group2: option1
field1: value1
field2: value2
key: "option one in group two"
You can also override single parameters or the entire options on group level via command line arguments:
group1:
field1: other value
field2: value2
group2:
key: "option two in group two"
python3 main.py group2=option2 group1.field1="other value"
defaults:
- group1: option2
- group2: option1
field1: value1
field2: value2
key: "option two in group two"
Read Hydra docs for a more detailed introduction into its features.