Open pfrwilson opened 1 year ago
Hello there @pfrwilson, thanks for posting!
Good catch, there does seem to be some statefullness going on with the parse_known_args. I'll take a look.
By the way, are you familiar with the subgroups
feature of simple-parsing? There is even an example that looks quite a bit like your use-case, here: https://github.com/lebrice/SimpleParsing/tree/master/examples/subgroups
As for the loading of config files for each subgroup, note that there is currently a bug with the dynamic selection of the subgroup dataclass (#276 ) but I'm working on it ;)
Thanks again for posting, I'll try to take a look at this soon.
Hi @lebrice, thanks for your response! No I was not previously aware of the subgroups
feature, but i'm excited to check it out as it does appear to address the same use-case already.
Love this project by the way!
Thanks again.
Describe the bug The behavior of
parser.print_help
is different after callingparser.parse_known_args()
, but it behaves correctly when calling the superclass (argparse.ArgumentParser
) version of the function.To Reproduce
Expected behavior The console should print a different message depending on which use case is specified:
Actual behavior The help message ignores the added dataclass, even though the correct dataclass is added to the config, with default values
Desktop (please complete the following information):
Additional context I am developing a system for dynamically added configuration groups with appropriate help message for the user e.g.
I believe this will be useful in alot of use cases, in particular one I had in mind was specifying a machine learning model (e.g resnet, inception) then having the correct constructor args dynamically added to the configuration and being given a more detailed help message as you go.