Skip to content

Commit d55dfb6

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 6eb159b commit d55dfb6

File tree

4 files changed

+14
-10
lines changed

4 files changed

+14
-10
lines changed

src/sourmash/commands.py

+1
Original file line numberDiff line numberDiff line change
@@ -946,6 +946,7 @@ def gather(args):
946946
# @CTB foo revindex
947947
from sourmash.index.revindex import RevIndex
948948
from sourmash.index import ZipFileLinearIndex
949+
949950
xx = []
950951
for db in databases:
951952
if isinstance(db, ZipFileLinearIndex):

src/sourmash/index/__init__.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ def counter_gather(self, query, threshold_bp, **kwargs):
311311
with query.update() as prefetch_query:
312312
prefetch_query.minhash = prefetch_query.minhash.flatten()
313313

314-
if 0: # @CTB
314+
if 0: # @CTB
315315
# find all matches and construct a CounterGather object.
316316
counter = CounterGather(prefetch_query)
317317
for result in self.prefetch(prefetch_query, threshold_bp, **kwargs):
@@ -321,6 +321,7 @@ def counter_gather(self, query, threshold_bp, **kwargs):
321321
return counter
322322
else:
323323
from .revindex import RevIndex
324+
324325
revindex = RevIndex(template=prefetch_query.minhash)
325326

326327
for result in self.prefetch(prefetch_query, threshold_bp, **kwargs):

src/sourmash/index/revindex.py

+8-6
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
from sourmash.manifest import CollectionManifest
1616

1717

18-
class RevIndex(RustObject): #, Index):
18+
class RevIndex(RustObject): # , Index):
1919
__dealloc_func__ = lib.revindex_free
2020
manifest = None
2121
is_database = True
@@ -171,7 +171,8 @@ def select(
171171
abund=None,
172172
containment=None,
173173
picklist=None,
174-
**kwargs):
174+
**kwargs,
175+
):
175176
_check_select_parameters(
176177
ksize=ksize,
177178
moltype=moltype,
@@ -246,7 +247,9 @@ def search(self, query, *args, **kwargs):
246247
for i in range(size):
247248
match = SearchResult._from_objptr(results_ptr[i])
248249
if match.score >= threshold:
249-
results.append(IndexSearchResult(match.score, match.signature, match.location))
250+
results.append(
251+
IndexSearchResult(match.score, match.signature, match.location)
252+
)
250253

251254
return results
252255

@@ -297,8 +300,7 @@ def best_containment(self, query_ss, *, threshold_bp=0, **kwargs):
297300
if not query_mh:
298301
raise ValueError("empty query")
299302
threshold = threshold_bp / query_mh.scaled / len(query_mh)
300-
results = self.search(query_ss, threshold=threshold,
301-
do_containment=True)
303+
results = self.search(query_ss, threshold=threshold, do_containment=True)
302304

303305
if results:
304306
results.sort(key=lambda x: -x.score)
@@ -459,7 +461,7 @@ def select(
459461
raise ValueError(f"revindex ksize is {my_ksize}, not {ksize}")
460462
if scaled is not None and scaled < my_scaled:
461463
raise ValueError(f"revindex scaled is {my_scaled}, not {scaled}")
462-
if 0 and moltype is not None and moltype != my_moltype: # @CTB
464+
if 0 and moltype is not None and moltype != my_moltype: # @CTB
463465
raise ValueError(f"revindex moltype is {my_moltype}, not {moltype}")
464466

465467
if picklist is not None:

tests/test_revindex.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
##
1818

1919

20-
class JaccardSearchBestOnly_ButIgnore(JaccardSearch): # @CTB remove?
20+
class JaccardSearchBestOnly_ButIgnore(JaccardSearch): # @CTB remove?
2121
"A class that ignores certain results, but still does all the pruning."
2222

2323
def __init__(self, ignore_list):
@@ -110,7 +110,7 @@ def test_revindex_best_containment():
110110

111111

112112
def test_revindex_gather_ignore():
113-
raise pytest.skip('not implemented')
113+
raise pytest.skip("not implemented")
114114
# check that RevIndex gather ignores things properly.
115115
sig2 = utils.get_test_data("2.fa.sig")
116116
sig47 = utils.get_test_data("47.fa.sig")
@@ -148,7 +148,7 @@ def test_revindex_insert_after_init():
148148

149149
ss2 = load_one_signature_from_json(sig2, ksize=31)
150150
ss47 = load_one_signature_from_json(sig47)
151-
ss63 = load_one_signature_from_json(sig63)
151+
load_one_signature_from_json(sig63)
152152

153153
lidx = RevIndex(template=ss2.minhash)
154154
lidx.insert(ss2)

0 commit comments

Comments
 (0)