diff --git a/src/sourmash/sbt.py b/src/sourmash/sbt.py index 62eb604c18..487816d294 100644 --- a/src/sourmash/sbt.py +++ b/src/sourmash/sbt.py @@ -390,7 +390,7 @@ def search(self, query, *args, **kwargs): # tree search should always/only return matches above threshold assert similarity >= threshold - results.append((similarity, leaf.data, self.location)) + results.append((similarity, leaf.data, self._location)) return results @@ -436,7 +436,7 @@ def gather(self, query, *args, **kwargs): containment = query.minhash.contained_by(leaf_mh, True) assert containment >= threshold, "containment {} not below threshold {}".format(containment, threshold) - results.append((containment, leaf.data, self.location)) + results.append((containment, leaf.data, self._location)) results.sort(key=lambda x: -x[0]) @@ -760,7 +760,7 @@ def load(cls, location, *, leaf_loader=None, storage=None, print_version_warning storage = klass(**jnodes['storage']['args']) obj = loader(jnodes, leaf_loader, dirname, storage, print_version_warning=print_version_warning, cache_size=cache_size) - obj.location = location + obj._location = location return obj @staticmethod diff --git a/tests/test_sbt.py b/tests/test_sbt.py index 25d864ea83..43f17af343 100644 --- a/tests/test_sbt.py +++ b/tests/test_sbt.py @@ -794,6 +794,8 @@ def test_sbt_protein_command_index(c): results = db2.gather(sig2) assert results[0][0] == 1.0 + assert results[0][2] == db2._location + assert results[0][2] == db_out @utils.in_thisdir @@ -840,6 +842,8 @@ def test_sbt_hp_command_index(c): results = db2.gather(sig2) assert results[0][0] == 1.0 + assert results[0][2] == db2._location + assert results[0][2] == db_out @utils.in_thisdir @@ -886,6 +890,8 @@ def test_sbt_dayhoff_command_index(c): results = db2.gather(sig2) assert results[0][0] == 1.0 + assert results[0][2] == db2._location + assert results[0][2] == db_out @utils.in_thisdir