-
Notifications
You must be signed in to change notification settings - Fork 53
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
Using config_path with subparsers does not seem to work #241
Comments
After some investigating, I can confirm that adding
right after https://github.com/lebrice/SimpleParsing/blob/master/simple_parsing/wrappers/field_wrapper.py#L1033 |
Hello there @aliounis , thanks so much for posting this! I'll try to look into this soon, but if you feel up to it and have time, sure, go ahead and create a PR! This config_path argument seems to be causing issues (see #239 ), so hopefully we can kill two birds with one stone here. Thanks again for posting! |
…e not being passed when using subparsers (field_wrapper.py). Additionally fixes an issue where subdataclasses were requiring every value to be defaulted in the config path, instead of falling back to the default in the dataclass definition if it wasn't (dataclass_wrapper.py)
I submitted the above PR. This also grabs a second bug fix where subdataclasses had to be fully specified int he config file or not at all (partial specification was not allowed) instead of falling back to the standard default as it does for non-dataclass types. Let me know if you'd like me to open a second issue to track this other bug or if the PR/this comment is fine. |
…e not being passed when using subparsers (field_wrapper.py). Additionally fixes an issue where subdataclasses were requiring every value to be defaulted in the config path, instead of falling back to the default in the dataclass definition if it wasn't (dataclass_wrapper.py)
Is this going to be fixed? is there are workaround? |
Hello there @tcapelle, sorry no work has been done on this in a while. I will take a look when I find the time, but you're more than welcome to take a crack at it in the meantime! Let me know if you encounter any issues. #243 is an attempt at a fix, but broke a few tests. I'd start from there if I were you. |
Describe the bug
I am attempting to use subparsers and the config_path option together, however, I cannot seem to get the config path to actually set the defaults. I have tried multiple "paths" in the json file for the config file, posted below, but non seem to work. I've tried to investigate myself and think that the issue might be because the subparser does not copy the defaults for the
command
attribute (which chooses the subparser).To Reproduce
Expected behavior
Running
with
sp_mew.py
being the above source code andmwe_config.json
containing either:or
(I don't care which format, either would be fine) should produce the output
Actual behavior
Instead, using either of the json formats we get the default output of
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: