From d8aa9f8c476a54ac1da206a5293f9cf77830ffab Mon Sep 17 00:00:00 2001 From: "C. Titus Brown" Date: Wed, 20 Jul 2022 14:14:27 -0700 Subject: [PATCH] avoid instantiating a hashes class (#2132) --- src/sourmash/minhash.py | 2 +- src/sourmash/search.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/sourmash/minhash.py b/src/sourmash/minhash.py index 97b9973aef..cd825fdb43 100644 --- a/src/sourmash/minhash.py +++ b/src/sourmash/minhash.py @@ -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): """ diff --git a/src/sourmash/search.py b/src/sourmash/search.py index d08545be20..41053ccb69 100644 --- a/src/sourmash/search.py +++ b/src/sourmash/search.py @@ -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):