Skip to content

Commit 6f308a3

Browse files
committed
improving comments
1 parent f29732f commit 6f308a3

File tree

1 file changed

+10
-13
lines changed

1 file changed

+10
-13
lines changed

stumpy/core.py

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -599,23 +599,19 @@ def check_window_size(m, max_size=None, n=None):
599599
# non-trivial neighbour in the case of a self-join.
600600

601601
# For any time series `T`, an "eligible nearest neighbor" subsequence for
602-
# the central-most subsequence must be located outside the `excl_zone`.
603-
# The central-most subsequence will ALWAYS have the smallest gap
604-
# to its furthest "eligible nearest neighbor" among all other subsequences.
605-
# Therefore, we only need to check whether the `excl_zone` eliminates all
606-
# "nearest neighbors" for the central-most subsequence in `T`.
607-
# In fact, we just need to verify whether the `excl_zone` eliminates
608-
# the "nearest neighbor" that is furthest away (index-wise) from
609-
# the central-most subsequence. If it does not, this implies that
610-
# all other subsequences in `T` will have at least one or more
611-
# eligible nearest neighbors outside their respective `excl_zone
602+
# the central-most subsequence must be located outside the `excl_zone`,
603+
# and the central-most subsequence will ALWAYS have the smallest gap
604+
# to its furthest neighbour. Therefore, we only need to check whether
605+
# the `excl_zone` eliminates all "neighbors" for the central-most subsequence
606+
# in `T`. In fact, we just need to verify whether the `excl_zone` eliminates
607+
# the "neighbor" that is furthest away (index-wise) from the central-most
608+
# subsequence. If it does not, this implies that all subsequences in `T`
609+
# will have at least one or more "eligible nearest neighbors" outside
610+
# their respective `excl_zone`
612611

613612
excl_zone = int(math.ceil(m / config.STUMPY_EXCL_ZONE_DENOM))
614613

615614
l = n - m + 1
616-
max_gap = l // 2
617-
# The index-wise gap between central-most subsequence
618-
# and its furthest neighbor:
619615

620616
# If `l` is odd (`l == 2k+1`):
621617
# The central subsequence is at index `k`, with furthest neighbors at `0`
@@ -625,6 +621,7 @@ def check_window_size(m, max_size=None, n=None):
625621
# The central subsequences are at `k-1` and `k`. The furthest neighbor is
626622
# at `2k-1` for `k-1`, and `0` for `k`. In both cases, the subsequence
627623
# and its furthest neighbor are `k == l // 2` indices away.
624+
max_gap = l // 2
628625

629626
if max_gap <= excl_zone:
630627
msg = (

0 commit comments

Comments
 (0)