fidelity / spock

spock is a framework that helps manage complex parameter configurations during research and development of Python applications
https://fidelity.github.io/spock/
Apache License 2.0
124 stars 13 forks source link

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

Open wanicca opened 2 years ago

wanicca commented 2 years ago

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 commented 2 years ago

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!

nagavenkateshgavini commented 7 months ago

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

ncilfone commented 7 months ago

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