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

MinHash compatibility check to sourmash sig intersect #1116

Merged
merged 3 commits into from
Jul 21, 2020

Conversation

erikyoung85
Copy link
Contributor

@erikyoung85 erikyoung85 commented Jul 20, 2020

This PR calls minhash.is_compatible(...) to check for MinHash compatibility before intersecting two MinHashes.
Fixes #1107

  • Is it mergeable?
  • make test Did it pass the tests?
  • make coverage Is the new code covered?
  • Did it change the command-line interface? Only additions are allowed
    without a major version increment. Changing file formats also requires a
    major version number increment.
  • Was a spellchecker run on the source code and documentation after
    changes were made?

@codecov
Copy link

codecov bot commented Jul 20, 2020

Codecov Report

Merging #1116 into master will increase coverage by 8.80%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1116      +/-   ##
==========================================
+ Coverage   83.84%   92.64%   +8.80%     
==========================================
  Files          98       74      -24     
  Lines        9111     5792    -3319     
==========================================
- Hits         7639     5366    -2273     
+ Misses       1472      426    -1046     
Flag Coverage Δ
#rusttests ?

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

Impacted Files Coverage Δ
sourmash/sig/__main__.py 93.34% <100.00%> (-0.06%) ⬇️
sourmash/_compat.py 52.17% <0.00%> (-47.83%) ⬇️
sourmash/signature.py 90.82% <0.00%> (-2.30%) ⬇️
sourmash/lca/lca_utils.py 91.20% <0.00%> (-1.60%) ⬇️
sourmash/lca/command_index.py 92.70% <0.00%> (-0.53%) ⬇️
sourmash/sbt.py 88.57% <0.00%> (-0.28%) ⬇️
src/core/src/index/mod.rs
src/core/src/ffi/nodegraph.rs
src/core/src/ffi/cmd/compute.rs
src/core/src/index/storage.rs
... and 22 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 21dc514...76fcfbd. Read the comment docs.

@ctb
Copy link
Contributor

ctb commented Jul 20, 2020

hmm, well, as long as we're here... per #1107 (comment), is_compatible returns a bool. Could you change the try/except here and in subtract to test is_compatible(...) and complaining, rather than catching an exception? thx!

@erikyoung85 erikyoung85 requested a review from ctb July 21, 2020 18:48
@ctb
Copy link
Contributor

ctb commented Jul 21, 2020

sorry, I misled you - instead of raising ValueError, can you do the error(...) and sys.exit(-1)? These are direct command line calls so it makes more sense for the user to see some error text than a raised exception, since non-Python programmers may be running these.

@erikyoung85
Copy link
Contributor Author

Oh definitely! Thats good to know, I was wondering about the difference between the two because I've seen both in the code.

Copy link
Contributor

@ctb ctb left a comment

Choose a reason for hiding this comment

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

thank you!

@ctb ctb merged commit d32c892 into master Jul 21, 2020
@ctb ctb deleted the minhash_check_compatible branch July 21, 2020 23:16
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.

define a canonical way to check compatibility of MinHash objects in Python
2 participants