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] Refactor/expand MinHash add, iadd, and merge functionality. #1282

Merged
merged 8 commits into from
Feb 6, 2021

Conversation

ctb
Copy link
Contributor

@ctb ctb commented Jan 18, 2021

This PR does a few things -

  • first and foremost, it fixes some funky and useless merge tests in test__minhash.py. These tests were relying on merge being in-place, but were written as if they were not.
  • second, it changes MinHash.merge to be only in-place, with no return value
  • third, it adds an __add__ method.
  • fourth, it provides some simple and very explicit tests of add, iadd, and merge.

Fixes #1211

TODO:

  • create issue to consider renaming rust merge function
  • create issue to deprecate in 3.5

Checklist

  • 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?

@ctb ctb changed the title Refactor/expand MinHash add, iadd, and merge functionality. [WIP] Refactor/expand MinHash add, iadd, and merge functionality. Jan 18, 2021
@codecov
Copy link

codecov bot commented Jan 18, 2021

Codecov Report

Merging #1282 (3b4a876) into latest (bc87da7) will increase coverage by 5.26%.
The diff coverage is 97.14%.

Impacted file tree graph

@@            Coverage Diff             @@
##           latest    #1282      +/-   ##
==========================================
+ Coverage   88.70%   93.96%   +5.26%     
==========================================
  Files         125       98      -27     
  Lines       18296    14758    -3538     
  Branches     1437     1438       +1     
==========================================
- Hits        16229    13868    -2361     
+ Misses       1822      643    -1179     
- Partials      245      247       +2     
Flag Coverage Δ
python 93.96% <97.14%> (+<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 93.30% <72.72%> (-1.24%) ⬇️
tests/test__minhash.py 99.31% <100.00%> (+0.05%) ⬆️
src/core/src/errors.rs
src/core/src/ffi/hyperloglog.rs
src/core/src/ffi/cmd/compute.rs
src/core/src/ffi/mod.rs
src/core/src/from.rs
src/core/src/encodings.rs
src/core/src/index/sbt/mod.rs
src/core/src/index/storage.rs
... and 19 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 bc87da7...3b4a876. Read the comment docs.

@ctb ctb added the 4.0 issues to address for a 4.0 release label Feb 5, 2021
@ctb
Copy link
Contributor Author

ctb commented Feb 5, 2021

Ready for review @luizirber

@ctb ctb changed the title [WIP] Refactor/expand MinHash add, iadd, and merge functionality. [MRG] Refactor/expand MinHash add, iadd, and merge functionality. Feb 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4.0 issues to address for a 4.0 release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

MinHash.merge() modifies signature inplace -- is it supposed to?
2 participants