-
Notifications
You must be signed in to change notification settings - Fork 51
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
Fixing deserialization issues for dataclasses with subgroup fields and nested dataclasses #211
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…disable it for nested dataclass
zhiruiluo
added a commit
to zhiruiluo/SimpleParsing
that referenced
this pull request
Jan 31, 2023
lebrice
added a commit
that referenced
this pull request
Feb 3, 2023
* add subgroups info on serialization * fix issue #210 fail on nested dataclasses * add tests * apply pre-commit hooks * remove log * renaming, rearranging, and adding comments for readability * init commit * rebase and add tests * check whethe the input of is dataclass instead of dictionary * init commit * rebase and add tests * make sure entries of new_values of replace function are unflattened * fix replace docstring * verify the type of raw_value when it is dataclass for subgroups, and disable it for nested dataclass * Set add_selected_subgroups to false and remove nested subgroups tests * fix test_replace.py * checkout serializable from deserialization_fix * replace raise TypeError for non dataclass instance * add test for mixed flatten and nested dictionary * remove changes from PR #211 and skip tests related to issue nested dataclass #210 * Update simple_parsing/replace.py utilze dataclasses.replace to simplify simple_parsing.replace. Co-authored-by: Fabrice Normandin <fabrice.normandin@gmail.com> * revise replace with dataclasses.replace and add test_replace_union_dataclass * Small formatting change in `replace.py` --------- Co-authored-by: Fabrice Normandin <fabrice.normandin@gmail.com>
This was referenced Mar 13, 2023
Closing in favor of #233 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR is the implementation for the contribution 1 mentioned in #197.
False
.to_dict
andfrom_dict
.from_dict
when either condition is true