Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: fix weird failing gather #2832

Open
wants to merge 2 commits into
base: latest
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/sourmash/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -801,7 +801,7 @@ def gather(args):
if prefetch_csvout_fp:
for found_sig in counter.signatures():
# calculate intersection stats and info
prefetch_result = PrefetchResult(prefetch_query, found_sig, cmp_scaled=scaled,
prefetch_result = PrefetchResult(prefetch_query, found_sig,
threshold_bp=args.threshold_bp, estimate_ani_ci=args.estimate_ani_ci)
if prefetch_csvout_w is None:
prefetch_csvout_w = prefetch_result.init_dictwriter(prefetch_csvout_fp)
Expand Down
9 changes: 6 additions & 3 deletions src/sourmash/index/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -807,15 +807,18 @@
if match_size < n_threshold_hashes:
return []

## at this point, we have a legitimate match above threshold!
## at this point, we should have a legitimate match above threshold!
# @CTB

# pull match and location.
match = siglist[dataset_id]

# calculate containment
# confirm containment and bail if due to downsampling,
# containment is no longer significant.
# CTB: this check is probably redundant with intersect_mh calc, below.
cont = cur_query_mh.contained_by(match.minhash, downsample=True)
assert cont
if cont == 0:
return []

Check warning on line 821 in src/sourmash/index/__init__.py

View check run for this annotation

Codecov / codecov/patch

src/sourmash/index/__init__.py#L821

Added line #L821 was not covered by tests
assert cont >= threshold

# calculate intersection of this "best match" with query.
Expand Down
Loading