Overriding a default for config group from the command line, when the value is also defined in the config file. #2812
Replies: 1 comment 4 replies
-
If I understand correctly, what you're trying to do is somewhat unusual, since the I'm not sure if there's a better way, but one workaround is to treat them as different config groups (since they are behaving differently). Something like this (not tested with your specific configs): defaults:
- /configuration_source: base
- _self_
- optional /configuration_source_override@configuration_source: null
configuration_source:
vmec_file_path: starfinder/inputs/input.nfp2_QA and then use on the command line You can do a |
Beta Was this translation helpful? Give feedback.
-
Hi all!
We have the following structure
config.yaml file - our root file
Contents:
Experiment files:
configs/experiment/stage-one.yaml
Contents:
Configuration source file:
configs/configuration_source/configuration1.yaml:
I am trying to override the configuration_source with the command line
my-binary experiment=stage-one configuration_source=configuration1
However, this does not work, since vmec_file_path: starfinder/inputs/input.nfp2_QA has a priority.
If I instead define in configs/experiment/stage-one.yaml
Then vmec_file_path: starfinder/inputs/input.nfp2_QA will always be overridden. E.g. running
my-binary experiment=stage-one
will take values from base.I feel like I am missing something here. Is there a proper way to achieve that the user input takes precedence, still using config groups?
thank you in advance!
Beta Was this translation helpful? Give feedback.
All reactions