Skip to content

Commit f8d6df5

Browse files
committed
update module to include extra check for self join
1 parent 87f3873 commit f8d6df5

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

stumpy/stump.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -711,20 +711,25 @@ def stump(
711711
"For multidimensional STUMP use `stumpy.mstump` or `stumpy.mstumped`"
712712
)
713713

714-
core.check_window_size(m, max_size=min(T_A.shape[0], T_B.shape[0]))
715-
ignore_trivial = core.check_ignore_trivial(T_A, T_B, ignore_trivial)
716-
717714
n_A = T_A.shape[0]
718715
n_B = T_B.shape[0]
719716
l = n_A - m + 1
720717

721-
excl_zone = int(np.ceil(m / config.STUMPY_EXCL_ZONE_DENOM))
722-
718+
ignore_trivial = core.check_ignore_trivial(T_A, T_B, ignore_trivial)
723719
if ignore_trivial:
720+
excl_zone = int(np.ceil(m / config.STUMPY_EXCL_ZONE_DENOM))
724721
diags = np.arange(excl_zone + 1, n_A - m + 1, dtype=np.int64)
725722
else:
723+
excl_zone = None
726724
diags = np.arange(-(n_A - m + 1) + 1, n_B - m + 1, dtype=np.int64)
727725

726+
core.check_window_size(
727+
m,
728+
max_size=min(T_A.shape[0], T_B.shape[0]),
729+
excl_zone=excl_zone,
730+
last_start_index=l - 1,
731+
)
732+
728733
P, PL, PR, I, IL, IR = _stump(
729734
T_A,
730735
T_B,

0 commit comments

Comments
 (0)