Skip to content
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

Fix usage of _convert_to_dict to avoid modifying nesting SyncedDict objects when calling items or values #269

Merged
merged 3 commits into from
Jan 19, 2020

Conversation

vyasr
Copy link
Contributor

@vyasr vyasr commented Jan 10, 2020

Description

A number of methods were calling _convert_to_dict on self._data rather than calling them on self. As a result, the member of the underlying dictionary was modified. Actually, we should be able to remove the dict branch of _convert_to_dict entirely, but that requires resolving #196 first (because that's the only way that branch is accessed). Further changes are probably worth postponing for when we address #249.

Motivation and Context

Resolves #234.

Types of Changes

  • Documentation update
  • Bug fix
  • New feature
  • Breaking change1

1The change breaks (or has the potential to break) existing functionality.

Checklist:

If necessary:

  • I have updated the API documentation as part of the package doc-strings.
  • I have created a separate pull request to update the framework documentation on signac-docs and linked it here.
  • I have updated the changelog and added all related issue and pull request numbers for future reference (if applicable). See example below.

Example for a changelog entry: Fix issue with launching rockets to the moon (#101, #212).

@vyasr vyasr requested review from a team as code owners January 10, 2020 18:15
@vyasr vyasr requested review from tcmoore3 and cbkerr and removed request for a team January 10, 2020 18:16
@vyasr vyasr self-assigned this Jan 10, 2020
@vyasr vyasr added the bug Something isn't working label Jan 10, 2020
@vyasr vyasr added this to the v1.3.1 milestone Jan 10, 2020
@bdice
Copy link
Member

bdice commented Jan 11, 2020

@vyasr Since the names of our CI checks changed with #266, you may need to merge master into this branch to make the required checks pass. I'm fine with you overriding the required checks if you want, since this PR is fairly small and doesn't touch anything altered in #266.

@codecov
Copy link

codecov bot commented Jan 15, 2020

Codecov Report

Merging #269 into master will decrease coverage by 0.34%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #269      +/-   ##
==========================================
- Coverage   65.42%   65.07%   -0.35%     
==========================================
  Files          42       40       -2     
  Lines        5697     5629      -68     
==========================================
- Hits         3727     3663      -64     
+ Misses       1970     1966       -4
Impacted Files Coverage Δ
signac/__main__.py 0% <ø> (ø) ⬆️
signac/contrib/__init__.py 92.59% <ø> (-0.27%) ⬇️
signac/core/json.py 72.72% <ø> (-0.61%) ⬇️
signac/contrib/utility.py 37.98% <ø> (-0.48%) ⬇️
signac/contrib/filterparse.py 82.25% <ø> (-0.29%) ⬇️
signac/contrib/project.py 90.86% <100%> (-0.02%) ⬇️
signac/contrib/import_export.py 84.89% <100%> (+0.15%) ⬆️
signac/contrib/job.py 90.63% <100%> (ø) ⬆️
signac/core/dict_manager.py 90.36% <100%> (ø) ⬆️
signac/core/h5store.py 90.45% <100%> (+0.17%) ⬆️
... and 1 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e5cd672...a3879da. Read the comment docs.

Copy link
Member

@tcmoore3 tcmoore3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@csadorf
Copy link
Contributor

csadorf commented Jan 17, 2020

@vyasr Can you update the name of this PR to be a bit more descriptive?

@vyasr
Copy link
Contributor Author

vyasr commented Jan 17, 2020

Yes, sorry it was a single commit so it just autopopulated the title and I didn't change it.

@vyasr vyasr changed the title Add tests that demonstrate problem and fix it. Resolves #234. Fix usage of _convert_to_dict to avoid modifying nesting SyncedDict objects when calling items or values Jan 17, 2020
@vyasr vyasr changed the title Fix usage of _convert_to_dict to avoid modifying nesting SyncedDict objects when calling items or values Fix usage of _convert_to_dict to avoid modifying nesting SyncedDict objects when calling items or values Jan 17, 2020
Copy link
Member

@cbkerr cbkerr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@bdice bdice merged commit 8ec1bc7 into master Jan 19, 2020
@bdice bdice deleted the fix/issue_234 branch January 19, 2020 00:01
@bdice bdice modified the milestones: v1.3.1, v1.4.0 Feb 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Calling _SyncedDict.values() gives dict objects
5 participants