Skip to content
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

Is it possible to set a default namespace for command-line arguments? #239

Open
wanicca opened this issue Mar 30, 2022 · 3 comments
Open
Labels
backlog features or issues to be worked on in the future good first issue Good for newcomers

Comments

@wanicca
Copy link

wanicca commented Mar 30, 2022

spock-config is a nice alternative to argparse. However, we have to add namespace name in argument (e.g. --BaseConfig.lr=value). That is sometimes cumbersome. If there is a way to set default namespace, the command-line arguments can work more like argparse.

Of course, to avoid conflict, some arguments (h,help,c,config) cannot be in such default namespace.

@ncilfone
Copy link
Contributor

Hi @wanicca

It's possible and I see the difficulty with verbosity (and not 1:1 drop in for argparse)...

However given the user defined hierarchy and inheritance, it's pretty hard to cleanly maintain a global namespace as well as a class specific namespace within the arg_parser (we already do this for file based definitions and it's a nightmare to maintain).

Happy to have you contribute via a PR if it's something you think you'd want to add, but as of right now I'd say this is probably a backlog item for the time being.

I'll leave the issue open for the time being so it stays on the backlog or for you to link to a PR if you want to contribute!

@ncilfone ncilfone added backlog features or issues to be worked on in the future good first issue Good for newcomers labels Apr 12, 2022
@nagavenkateshgavini
Copy link

@ncilfone I would like to work on this, could you please assign this to me

@ncilfone
Copy link
Contributor

I do not have the power to assign anymore but that doesn't prevent you from working on a PR to contribute!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backlog features or issues to be worked on in the future good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants