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

provide & and | operators for MinHash #1479

Closed
ctb opened this issue Apr 22, 2021 · 3 comments
Closed

provide & and | operators for MinHash #1479

ctb opened this issue Apr 22, 2021 · 3 comments
Labels
good next issue An issue that should be ready to resolve. python Pull requests that update Python code

Comments

@ctb
Copy link
Contributor

ctb commented Apr 22, 2021

In #1474 / #1392, we provide MinHash.intersection(...) which joins MinHash.merge(...) (equivalent to union).

At the time I couldn't figure out how to provide analogs to the set intersection and union operators, which are & and |. @luizirber pointed out that it's as simple as providing __and__ and __or__ on MinHash classes; see this post for example.

To fix this issue,

  • add __and__ and __or__ methods on the MinHash class;
  • add some tests to tests/test__minhash.py that confirms they do the same thing as intersection and __add__, respectively;
@bluegenes
Copy link
Contributor

should this be closed? @hehouts @ctb

@hehouts
Copy link
Contributor

hehouts commented Jun 11, 2021

yes! didnt think to do this, my bad

@hehouts hehouts closed this as completed Jun 11, 2021
@ctb
Copy link
Contributor Author

ctb commented Jun 14, 2021

ok - for future reference, "Fixes #" in a PR will auto-close it, which is what should have happened, but I just noticed you had "Fixes issue #" which doesn't meet the very strict pattern that github looks for 😉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good next issue An issue that should be ready to resolve. python Pull requests that update Python code
Projects
None yet
Development

No branches or pull requests

3 participants