Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
3919b53
revise sliding dot product functions
NimaSarajpoor Jan 22, 2026
74aed07
Merge branch 'main' into enhance_sliding_dot_product
NimaSarajpoor Jan 23, 2026
3c70d47
Moved functions to sdp module
NimaSarajpoor Jan 24, 2026
203869e
add sdp functions and their tests
NimaSarajpoor Jan 24, 2026
a2b5d4e
minor fix for cases without any docstring
NimaSarajpoor Jan 24, 2026
c20c8dc
add pyfftw_sdp, tests, and relevant fixes
NimaSarajpoor Jan 25, 2026
f6d5054
minor fix
NimaSarajpoor Jan 25, 2026
44d4ee0
update pyproject.toml
NimaSarajpoor Jan 25, 2026
2f40bcd
merge from main and resolve conflicts
NimaSarajpoor Jan 28, 2026
0ed0cf0
revert change
NimaSarajpoor Jan 28, 2026
2832230
Merge branch 'main' into enhance_sliding_dot_product
NimaSarajpoor Feb 1, 2026
84eb855
minor change
NimaSarajpoor Feb 1, 2026
4dd4b54
minor change
NimaSarajpoor Feb 1, 2026
3fde978
improve coverage and fix test
NimaSarajpoor Feb 1, 2026
ee58563
revert environment yml file and fix coverage
NimaSarajpoor Feb 1, 2026
1de5370
minor change
NimaSarajpoor Feb 1, 2026
3f69885
improve coverage test for pyfftw
NimaSarajpoor Feb 2, 2026
d320d97
improve regex pattern for capturing pyfftw
NimaSarajpoor Feb 2, 2026
a318173
merge, resolve conflict, and minor changes
NimaSarajpoor Feb 2, 2026
39920de
fixed regex pattern for removing tests from coverage
NimaSarajpoor Feb 3, 2026
e446369
addressed comments
NimaSarajpoor Feb 3, 2026
e3c37a3
add oaconvolve and general function
NimaSarajpoor Feb 3, 2026
ed8e0fd
add test function to check empty list for boundaries
NimaSarajpoor Feb 3, 2026
27072de
remove unncessary warning
NimaSarajpoor Feb 3, 2026
ff11e3a
fix coverage
NimaSarajpoor Feb 3, 2026
1ea94ed
minor change
NimaSarajpoor Feb 4, 2026
d0dab71
minor chanage in default sdp and core sdp
NimaSarajpoor Feb 4, 2026
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
37 changes: 6 additions & 31 deletions stumpy/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,9 @@
from numba import cuda, njit, prange
from scipy import linalg
from scipy.ndimage import maximum_filter1d, minimum_filter1d
from scipy.signal import convolve
from scipy.spatial.distance import cdist

from . import config
from . import config, sdp

try:
from numba.cuda.cudadrv.driver import _raise_driver_not_found
Expand Down Expand Up @@ -652,7 +651,8 @@ def check_window_size(m, max_size=None, n=None):
@njit(fastmath=config.STUMPY_FASTMATH_TRUE)
def _sliding_dot_product(Q, T):
"""
A Numba JIT-compiled implementation of the sliding window dot product.
A wrapper for numba JIT-compiled implementation of
the sliding dot product.

Parameters
----------
Expand All @@ -667,18 +667,12 @@ def _sliding_dot_product(Q, T):
out : numpy.ndarray
Sliding dot product between `Q` and `T`.
"""
m = Q.shape[0]
l = T.shape[0] - m + 1
out = np.empty(l)
for i in range(l):
out[i] = np.dot(Q, T[i : i + m])

return out
return sdp._njit_sliding_dot_product(Q, T)


def sliding_dot_product(Q, T):
"""
Use FFT convolution to calculate the sliding window dot product.
Compute the sliding dot product between `Q` and `T`.

Parameters
----------
Expand All @@ -692,27 +686,8 @@ def sliding_dot_product(Q, T):
-------
output : numpy.ndarray
Sliding dot product between `Q` and `T`.

Notes
-----
Calculate the sliding dot product

`DOI: 10.1109/ICDM.2016.0179 \
<https://www.cs.ucr.edu/~eamonn/PID4481997_extend_Matrix%20Profile_I.pdf>`__

See Table I, Figure 4

Following the inverse FFT, Fig. 4 states that only cells [m-1:n]
contain valid dot products

Padding is done automatically in fftconvolve step
"""
n = T.shape[0]
m = Q.shape[0]
Qr = np.flipud(Q) # Reverse/flip Q
QT = convolve(Qr, T)

return QT.real[m - 1 : n]
return sdp._sliding_dot_product(Q, T)
Copy link
Collaborator Author

@NimaSarajpoor NimaSarajpoor Feb 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI: If we pass boundaries=[], then this will be the same as the function in branch main. However, I think it is safe to use the default value, which is:

boundaries=[
        [(-np.inf, 2**7 + 1), (-np.inf, np.inf), _njit_sliding_dot_product],
]



@njit(
Expand Down
Loading