-
-
Notifications
You must be signed in to change notification settings - Fork 644
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ability to specify composition order of primary config file #326
Comments
cc @erikwijmans , I think this got in your way. |
Yeah, the SELF thing would work for my use-case. If possible, could there be a flag to set for the default position of SELF? So that you can keep the current method (merge SELF first) as default or change to merge SELF last by default? |
not sure that would be possible (defaults are evaluated before the rest of the config). I am starting to think of this order as a default that just works:
Note that a user can still change defaults in previous config groups and that would not change the composition order. It seems like this would be good alternative to supporting Generally, there aren't many use cases of frameworks using Hydra yet, so it's still acceptable to change this behavior. |
I think |
The primary motivation here is to address the framework use case better.
defaults:
- _SELF_
- hydra/launcher: my_launcher would actually result in hydra/launcher being merged in before SELF. There might still be room for it though, but I would want to explore it once things settles down as implementing it early might limit the design space. by the way, a less magical form of this is to specify the file name:
defaults:
- my_config
- foo: bar |
switching to target to 1.1.0 as there is a workaround for now and this is a big change with significant implications. |
There are multiple use cases for having configuration in the users config:
Use it as scaffolding and use defaults to populate it:
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:
In 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:
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:
or:
In the first case, the config file would be composed before foo/bar, in the second one after.
The text was updated successfully, but these errors were encountered: