Skip to content

Commit 50b9c2f

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

File tree

3 files changed

+11
-10
lines changed

3 files changed

+11
-10
lines changed

src/sourmash/index/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ def counter_gather(self, query, threshold_bp, **kwargs):
323323
from .revindex import RevIndex
324324

325325
revindex = RevIndex(template=prefetch_query.minhash)
326-
#return revindex.CounterGather(prefetch_query, threshold_bp, **kwargs)
326+
# return revindex.CounterGather(prefetch_query, threshold_bp, **kwargs)
327327

328328
for result in self.prefetch(prefetch_query, threshold_bp, **kwargs):
329329
revindex.insert(result.signature)

src/sourmash/index/revindex.py

+5-6
Original file line numberDiff line numberDiff line change
@@ -574,9 +574,9 @@ def __init__(self, query, db, threshold_bp, *, allow_insert=False):
574574
self.allow_insert = allow_insert
575575
self.locations = dict()
576576

577-
def add(self, match_ss, *, location=None, require_overlap=True): # @CTB location
577+
def add(self, match_ss, *, location=None, require_overlap=True): # @CTB location
578578
if self.allow_insert:
579-
x = self.db._check_not_init(do_raise=False)
579+
self.db._check_not_init(do_raise=False)
580580
if self.db._check_not_init(do_raise=False):
581581
self.db.insert(match_ss)
582582
else:
@@ -592,13 +592,13 @@ def add(self, match_ss, *, location=None, require_overlap=True): # @CTB location
592592

593593
self.found_mh += intersect_mh
594594

595-
def peek(self, query_mh, *, threshold_bp=0): # threshold_bp default?? @CTB
595+
def peek(self, query_mh, *, threshold_bp=0): # threshold_bp default?? @CTB
596596
if not query_mh:
597597
return []
598598

599599
if query_mh.contained_by(self.orig_query_mh) != 1.0:
600600
raise ValueError
601-
#assert threshold_bp is not None
601+
# assert threshold_bp is not None
602602

603603
res = self.db.peek(query_mh, threshold_bp=threshold_bp)
604604
if not res:
@@ -607,8 +607,7 @@ def peek(self, query_mh, *, threshold_bp=0): # threshold_bp default?? @CTB
607607
sr, intersect_mh = res
608608
sr_ss = sr.signature
609609
sr_score = sr.score
610-
new_sr = IndexSearchResult(sr_score, sr_ss,
611-
self.locations[sr_ss.md5sum()])
610+
new_sr = IndexSearchResult(sr_score, sr_ss, self.locations[sr_ss.md5sum()])
612611
return new_sr, intersect_mh
613612

614613
def consume(self, intersect_mh):

tests/test_index_protocol.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -703,8 +703,10 @@ def consume(self, intersect_mh):
703703

704704
## XXX @CTB
705705

706+
706707
def build_RevIndex_CounterGather(query):
707708
from sourmash.index.revindex import RevIndex_CounterGather
709+
708710
ri = RevIndex(template=query.minhash)
709711
cg = RevIndex_CounterGather(query, ri, 0, allow_insert=True)
710712
return cg
@@ -715,7 +717,7 @@ def build_RevIndex_CounterGather(query):
715717
CounterGather,
716718
CounterGather_LinearIndex,
717719
CounterGather_LCA,
718-
build_RevIndex_CounterGather
720+
build_RevIndex_CounterGather,
719721
]
720722
)
721723
def counter_gather_constructor(request):
@@ -1184,9 +1186,9 @@ def test_counter_gather_add_after_consume(counter_gather_constructor):
11841186
query_ss = SourmashSignature(query_mh, name="query")
11851187

11861188
# load up the counter
1187-
print('create')
1189+
print("create")
11881190
counter = counter_gather_constructor(query_ss)
1189-
print('insert')
1191+
print("insert")
11901192
counter.add(query_ss, location="somewhere over the rainbow")
11911193

11921194
counter.consume(query_ss.minhash)

0 commit comments

Comments
 (0)