-
-
Notifications
You must be signed in to change notification settings - Fork 50
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
Feature request: Separate config in the same CLI #32
Comments
There is already this kind of support for some actions. namely: parser = jsonargparse.ArgumentParser()
parser_model = jsonargparse.ArgumentParser()
parser_data = jsonargparse.ArgumentParser()
parser_model.add_class_arguments(Model)
parser_data.add_class_arguments(Data)
parser.add_argument('--model`, action=ActionParser(parser=parser_model))
parser.add_argument('--data`, action=ActionParser(parser=parser_data)) There is no need to have an explicit config key for each. That is, from the command line it can be given as data: data_config.yaml
model: model_config.yaml Then again, it wouldn't be a bad idea to add the support of sub config files for nested keys created by |
I'll have a look at the things you point to, thanks for your answer. |
…d in signatures and jsonschema. - Signature arguments can now be loaded from independent config files #32. - parse_args now has a _skip_check option like the other parse methods. - Added explicit 'from ex' in some reraises.
In master this is now implemented. By using |
This is now in release v3.2.0. |
I forgot to mention in the other issues, but I've been looking at the source code a bit and playing with it and it seems great, so thanks! Making it similar to
argparse
was a great choice and will definitely weight in a lot for our adoption ofjsonargparse
.One of the current possible way is to use
--print_config
, overwrite what we want and use--config
to run the CLI.In Asteroid (an audio source separation library), we support several datasets and several architectures. If we'd like to run the exact same architecture with the same trainer on all the datasets, could we think about composing config files so that a sub config file for an architecture could be reusable in several places?
Is this already possible? Maybe I didn't dig enough.
You might want to have a look at this PR in Asteroid which describes a bit what we'd use it for.
Example
It might look like that, where the
--config
is still necessary because the CLI would dumpexperiment_config.yml
somewhere for reproducibility, and we could re-instantiate the run directly using--config
.This is probably the last issue I'll raise tonight 😉
The text was updated successfully, but these errors were encountered: