-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Addresses #1167 by fixing `signature_first_mh` in the signature FFI to support both `KmerMinHash` and `KmerMinHashBTree`; this way, sketches generated by the Python `_signatures_for_sketch_factory` (which are BTree sketches in Rust) can be passed back to Python. Specifically, this PR: * implements `From<&KmerMinHashBTree>` for `KmerMinHash`; * adds an arm to the match statement in the FFI function to catch `KmerMinHashBTree` structs and convert them into `KmerMinHash` structs suitable for returning to Python; * provides a default match arm to catch (e.g.) `HyperLogLog` and raise an error back to Python reporting that it found an unsupported sketch type; * adds a little to the Python tests to prevent backsliding. Note that I don't _think_ this does any more copying of sketches than the current codebase does. And, on that halcyonic day when the FFI properly wraps `KmerMinHashBTree`, this code can be replaced by returning the proper Rust object without conversion. Fixes #1167.
- Loading branch information
Showing
3 changed files
with
40 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters