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

[MRG] fix pickle protocol to properly adjust ksize in __getstate__ #2265

Merged
merged 4 commits into from
Sep 6, 2022

Conversation

ctb
Copy link
Contributor

@ctb ctb commented Sep 6, 2022

Our pickle protocol was broken for non-DNA MinHash objects.

This PR fixes MinHash.__getstate__, removes an earlier partial fix in MinHash.to_mutable(), and adds tests at both the object level and the command line level.

Fixes #2262

TODO:

  • add tests for dayhoff and hp

@codecov
Copy link

codecov bot commented Sep 6, 2022

Codecov Report

Merging #2265 (12f3a17) into latest (2e0175a) will increase coverage by 7.34%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           latest    #2265      +/-   ##
==========================================
+ Coverage   84.85%   92.19%   +7.34%     
==========================================
  Files         131      100      -31     
  Lines       15664    11385    -4279     
  Branches     2249     2248       -1     
==========================================
- Hits        13291    10496    -2795     
+ Misses       2082      598    -1484     
  Partials      291      291              
Flag Coverage Δ
python 92.19% <ø> (-0.01%) ⬇️
rust ?

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/sourmash/minhash.py 94.05% <ø> (-0.03%) ⬇️
src/core/src/index/mod.rs
src/core/src/sketch/minhash.rs
src/core/src/ffi/mod.rs
src/core/src/ffi/cmd/compute.rs
src/core/src/ffi/utils.rs
src/core/src/ffi/index/revindex.rs
src/core/src/index/search.rs
src/core/src/lib.rs
src/core/src/ffi/nodegraph.rs
... and 22 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@ctb ctb changed the title [WIP] fix pickle protocol to properly adjust ksize in __getstate__ [MRG] fix pickle protocol to properly adjust ksize in __getstate__ Sep 6, 2022
@ctb
Copy link
Contributor Author

ctb commented Sep 6, 2022

@dkoslicki this should be ready for review, if you're up for it! You don't need to verify that it fixes your specific problem in #2262 - just skim through the PR description, and the code changes, and make sure they match, and check that all the github actions succeed(ed)!

(You can either formally review, or just say "looks good to me".)

@ctb
Copy link
Contributor Author

ctb commented Sep 6, 2022

(more generally, any @sourmash-bio/devs are welcome to review - it's a straightforward fix ;)

Copy link
Collaborator

@dkoslicki dkoslicki 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 to me!

@ctb
Copy link
Contributor Author

ctb commented Sep 6, 2022

thanks!

@ctb ctb merged commit beb96a3 into latest Sep 6, 2022
@ctb ctb deleted the fix/pickle_protein branch September 6, 2022 21:11
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.

Failed assertion when using compare with --ani in parallel
2 participants