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

define a canonical way to check compatibility of MinHash objects in Python #1107

Closed
ctb opened this issue Jul 17, 2020 · 5 comments · Fixed by #1116
Closed

define a canonical way to check compatibility of MinHash objects in Python #1107

ctb opened this issue Jul 17, 2020 · 5 comments · Fixed by #1116

Comments

@ctb
Copy link
Contributor

ctb commented Jul 17, 2020

I'm running into a bug in sourmash sig intersect where it doesn't check the compatibility of the MinHash objects (ksize, moltype, etc.) before doing the intersection. What's the canonical way to do this?

The Rust API defines a check_compatible function - @luizirber is this an appropriate function to expose via the Python API?

@ctb
Copy link
Contributor Author

ctb commented Jul 17, 2020

(for now, I'm using count_common to check)

@luizirber
Copy link
Member

I'm running into a bug in sourmash sig intersect where it doesn't check the compatibility of the MinHash objects (ksize, moltype, etc.) before doing the intersection. What's the canonical way to do this?

The Rust API defines a check_compatible function - @luizirber is this an appropriate function to expose via the Python API?

I think so. There is a ksize check commented out because something was breaking when it was activated, but I think it was fixed.

@erikyoung85
Copy link
Contributor

is there any reason to not use the minhash function is_compatible(self, other_minhash)? From what I can understand, it calls the rust check_compatible function you mentioned earlier. I'll push the line I added to the intersect(...) function.

@ctb
Copy link
Contributor Author

ctb commented Jul 20, 2020 via email

@luizirber
Copy link
Member

is there any reason to not use the minhash function is_compatible(self, other_minhash)? From what I can understand, it calls the rust check_compatible function you mentioned earlier. I'll push the line I added to the intersect(...) function.

Great catch! check_compatible throws an exception, is_compatible returns a bool. (and I forgot it was exposed already 🤣 )

@ctb ctb closed this as completed in #1116 Jul 21, 2020
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 a pull request may close this issue.

3 participants