-
-
Notifications
You must be signed in to change notification settings - Fork 809
Description
There are multiple use cases for having configuration in the users config:
Use it as scaffolding and use defaults to populate it:
defalts:
- foo: bar
foo:
a: ???
b: ???In the above case foo/bar.yaml can be used to populate a and b.
An alternative approach is to allow the user to override things populated by the defaults from the config file:
defalts:
- foo: bar
foo:
a: 10
b: 20In this scenario, the user wants to force foo.a and foo.b to specific values.
Those two approaches are conflicting, each one requires a different composition order.
Currently, the supported mode is the first one and the second is not possible.
Composition order is roughly:
- hydra related configs
- user config file
- user provided defaults
The idea is to support explicit specification of when to merge in the users config via a special keyword in the defaults, like _self_.
for example:
defalts:
- _self_
- foo: baror:
defalts:
- foo: bar
- _self_In the first case, the config file would be composed before foo/bar, in the second one after.