Skip to content

Commit

Permalink
typing for common_sub_strings module
Browse files Browse the repository at this point in the history
  • Loading branch information
Kawin committed Oct 6, 2024
1 parent 80bb5c9 commit 9986318
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/pydna/common_sub_strings.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
from operator import itemgetter as _itemgetter
from typing import List as _List, Tuple as _Tuple

Match = _Tuple[int, int, int]
Match = _Tuple[int, int, int] # (x_start, y_start, length)

# def _kark_sort(s, SA, n, K):
# def radixpass(a, b, r, s, n, k):
Expand Down Expand Up @@ -314,7 +314,7 @@
# return match


def common_sub_strings(stringx: str, stringy: str, limit=25) -> _List[Match]:
def common_sub_strings(stringx: str, stringy: str, limit: int = 25) -> _List[Match]:
"""
Finds all common substrings between stringx and stringy, and returns
them sorted by length.
Expand Down Expand Up @@ -344,7 +344,7 @@ def common_sub_strings(stringx: str, stringy: str, limit=25) -> _List[Match]:
return matches


def terminal_overlap(stringx: str, stringy: str, limit=15) -> _List[Match]:
def terminal_overlap(stringx: str, stringy: str, limit: int = 15) -> _List[Match]:
"""Finds the the flanking common substrings between stringx and stringy
longer than limit. This means that the results only contains substrings
that starts or ends at the the ends of stringx and stringy.
Expand Down

0 comments on commit 9986318

Please sign in to comment.