Skip to content

Commit 7f4f59a

Browse files
committed
Add a note about caching
1 parent 7edaed6 commit 7f4f59a

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

micall/utils/referenceless_contig_stitcher.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -469,6 +469,13 @@ def find_overlap_cutoffs(
469469
Tuple (left_cutoff, right_cutoff) on success, or None if no valid
470470
overlap region satisfies the minimum score.
471471
"""
472+
473+
# Note:
474+
# It is fine to omit `minimum_score` from the cache key because
475+
# the cutoffs are monotonic with respect to `minimum_score`.
476+
# Increasing `minimum_score` can only reduce the valid overlap region,
477+
# never expand it. Therefore, the cutoffs computed for a lower
478+
# `minimum_score` are always valid for a higher one.
472479
key = (left.id, right.id)
473480
existing = cutoffs_cache.get(key, -1)
474481
if existing != -1:

0 commit comments

Comments
 (0)