-
Notifications
You must be signed in to change notification settings - Fork 3
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
load config from command arguments #15
Comments
from chanfig import Config
from rich import print
if __name__ == '__main__':
config = config.parse(default_config="config")
print(config)
|
Thank you. It fixed it. |
sorry for the late response, I have just tested the snippet, however, when run with ❯ python run.py --config configs/exps/test.yaml --help
usage: run.py [-h] [--config CONFIG]
options:
-h, --help show this help message and exit
--config CONFIG |
Im not sure if it’s possible to achieve this. Merging a config file happens after parsed the command line arguments.
|
Yes, I know it is a little weird to load from config and then add to the argparse, but it could be better if we can support this. This may change a lot of logic when loading and parsing the config. |
Yes, I'll need some time for this, hopefully by the end of August. |
Hi, I want to use
--from_yaml
to specify use which config file, then load it toConfig
, useConfig.parse()
to modify the specified config.The current code is:
While it is a little ugly, and when run with
--help
, it only shows help messages ofyaml_config
since the first parser is used.Is there a more elegant way to do so?
The text was updated successfully, but these errors were encountered: