spock
spock copied to clipboard
Is it possible to set a default namespace for command-line arguments?
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.
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 I would like to work on this, could you please assign this to me
I do not have the power to assign anymore but that doesn't prevent you from working on a PR to contribute!