oxli-bio / oxli

k-mers and the like
BSD 3-Clause "New" or "Revised" License
16 stars 0 forks source link

Add Set Operation Methods #12

Closed Adamtaranto closed 2 months ago

Adamtaranto commented 2 months ago

I've added support for set operations on KmerHashTable objects.

I'm very new to Rust, but the test cases I've written are passing. Review with caution!

Summary of changes:

# Perform set operations on the KmerHashTable objects
union_hashes = kmer_table1.union(kmer_table2)
intersection_hashes = kmer_table1.intersection(kmer_table2)
difference_hashes = kmer_table1.difference(kmer_table2)
symmetric_difference_hashes = kmer_table1.symmetric_difference(kmer_table2)
Adamtaranto commented 2 months ago

Feel free to add any code comments, I'm still new to Rust conventions.

What do you think of the function name get_hash_array() - is it confusing that it actually returns a list?

Happy to be a maintainer on PyPi and conda-forge.

Sure, I think this is self-contained enough for a release. Unless you want to wait until wheel issue #15 is fixed.

Adamtaranto commented 2 months ago

Also, should I add a get_array() function for symmetry between the kmer/hash get functions?

i.e. to return counts for an ordered list of kmers.