Skip to content

Commit

Permalink
avoid instantiating a hashes class
Browse files Browse the repository at this point in the history
  • Loading branch information
ctb committed Jul 20, 2022
1 parent 2054391 commit 0d94cde
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
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

0 comments on commit 0d94cde

Please sign in to comment.