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] speed up prefetch by adjusting calls to use len(minhash) #2132

Merged
merged 1 commit into from
Jul 20, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/sourmash/minhash.py
Original file line number Diff line number Diff line change
Expand Up @@ -970,7 +970,7 @@ def unique_dataset_hashes(self):
if not self.scaled:
raise TypeError("can only approximate unique_dataset_hashes for scaled MinHashes")
# TODO: replace set_size with HLL estimate when that gets implemented
return len(self.hashes) * self.scaled # + (self.ksize - 1) for bp estimation
return len(self) * self.scaled # + (self.ksize - 1) for bp estimation

def size_is_accurate(self, relative_error=0.20, confidence=0.95):
"""
Expand Down
4 changes: 2 additions & 2 deletions src/sourmash/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,8 +235,8 @@ def get_cmpinfo(self):
# could define in PrefetchResult instead, same reasoning as above
self.query_abundance = self.mh1.track_abundance
self.match_abundance = self.mh2.track_abundance
self.query_n_hashes = len(self.mh1.hashes)
self.match_n_hashes = len(self.mh2.hashes)
self.query_n_hashes = len(self.mh1)
self.match_n_hashes = len(self.mh2)

@property
def pass_threshold(self):
Expand Down