Skip to content

Fix atom-structure pickle #26

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

Merged
merged 5 commits into from
Apr 18, 2019

Conversation

pavoljuhas
Copy link
Member

@pavoljuhas pavoljuhas commented Apr 17, 2019

CI - only, do not merge.
Fix Atom/Structure identity relation after pickling which broke in Python 3.7:

a1, stru1 = pickle.loads(pickle.dumps([stru[0], stru]))
assert a1 is stru1[0]

Fixes diffpy/diffpy.srfit#56.

Also fix deprecation warning in Python 3.7 on `Iterable`
move to `collections.abc`.
Import it as `copymod` so it does not shadow argument name.
Make sure first Atom stays contained after un-pickling.
Use more delicate copying behavior in `Structure.extend()`.
@codecov
Copy link

codecov bot commented Apr 17, 2019

Codecov Report

Merging #26 into master will increase coverage by 0.04%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #26      +/-   ##
==========================================
+ Coverage   94.65%   94.69%   +0.04%     
==========================================
  Files          43       43              
  Lines        4973     4998      +25     
==========================================
+ Hits         4707     4733      +26     
+ Misses        266      265       -1
Impacted Files Coverage Δ
src/diffpy/structure/tests/teststructure.py 100% <100%> (ø) ⬆️
src/diffpy/structure/structure.py 99.28% <100%> (+0.02%) ⬆️
src/diffpy/structure/utils.py 100% <100%> (ø) ⬆️
src/diffpy/structure/atom.py 88.88% <0%> (+0.58%) ⬆️

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 708a754...eab12a2. Read the comment docs.

Also use more descriptive variable names.
No change in code function.
@pavoljuhas pavoljuhas merged commit eab12a2 into diffpy:master Apr 18, 2019
@pavoljuhas pavoljuhas deleted the fix-atom-structure-pickle branch April 18, 2019 15:54
@pavoljuhas pavoljuhas mentioned this pull request Apr 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

FitRecipe returns different results when it is running in parallel
1 participant