Skip to content

Add pyfftw sdp#1132

Open
NimaSarajpoor wants to merge 18 commits into
stumpy-dev:mainfrom
NimaSarajpoor:add_pyfftw_sdp
Open

Add pyfftw sdp#1132
NimaSarajpoor wants to merge 18 commits into
stumpy-dev:mainfrom
NimaSarajpoor:add_pyfftw_sdp

Conversation

@NimaSarajpoor
Copy link
Copy Markdown
Collaborator

This is to address PR 3 described in #1118 (comment). Have copied the corresponding notes below:

  1. Add _PYFFTW_SLIDING_DOT_PRODUCT to sdp.py
  2. Add unit tests that demonstrate that _PYFFTW_SLIDING_DOT_PRODUCT matches the results of naive_rolling_window_dot_product
  3. Handle the test.sh check_fftw_pyfftw stuff here too

@gitnotebooks
Copy link
Copy Markdown

gitnotebooks Bot commented Feb 17, 2026

Review these changes at https://app.gitnotebooks.com/stumpy-dev/stumpy/pull/1132

Comment thread stumpy/sdp.py Outdated
Comment thread stumpy/sdp.py
Comment thread tests/test_sdp.py Outdated
Copy link
Copy Markdown
Contributor

@seanlaw seanlaw left a comment

Choose a reason for hiding this comment

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

@NimaSarajpoor I've left some comments for you to address. I think we can afford to be clearer since all of this pyfftw stuff will be hard to maintain. We should probably be as verbose (and add more comments cross referencing their docs as possible). I'll do another few passes after you've responded and made modifications. I think this pyfftw stuff needs to be crystal clear

Comment thread stumpy/sdp.py Outdated
Comment thread stumpy/sdp.py Outdated
Comment thread stumpy/sdp.py Outdated
Comment thread stumpy/sdp.py Outdated
Comment thread stumpy/sdp.py
Comment thread stumpy/sdp.py
Comment thread stumpy/sdp.py Outdated
Comment thread stumpy/sdp.py
Comment thread stumpy/sdp.py Outdated
Comment thread stumpy/sdp.py Outdated
Comment thread test.sh Outdated
Comment thread stumpy/sdp.py Outdated
Comment thread test.sh Outdated
@NimaSarajpoor
Copy link
Copy Markdown
Collaborator Author

@seanlaw
This PR should be ready to be merged if there are no concerns.

Comment thread stumpy/sdp.py Outdated
Comment thread stumpy/sdp.py
except ImportError: # pragma: no cover
PYFFTW_IS_AVAILABLE = False


Copy link
Copy Markdown
Collaborator Author

@NimaSarajpoor NimaSarajpoor May 21, 2026

Choose a reason for hiding this comment

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

Maybe add a comment here that says: "The name of any callable object that computes the sliding dot product should end with sliding_dot_product"

Comment thread tests/test_sdp.py
pytest.skip("Skipping Test pyFFTW Not Installed")

# This test checks that the pyfftw_sdp can be initialized
# with multiple threads and longdouble data type
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Suggested change
# with multiple threads and longdouble data type
# longdouble data type, and then called in a multithreaded mode.

Note that the number of threads is not set when the instance is created

Comment thread tests/test_sdp.py
if not sdp.PYFFTW_IS_AVAILABLE: # pragma: no cover
pytest.skip("Skipping Test pyFFTW Not Installed")

# This test checks that the pyfftw_sdp can be initialized
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Suggested change
# This test checks that the pyfftw_sdp can be initialized
# This test checks that the pyfftw_sdp instantiated object
can be called in a multithreaded mode.

Comment thread tests/test_sdp.py
pytest.skip("Skipping Test pyFFTW Not Installed")

# This test checks that the pyfftw_sdp can be initialized
# with multiple threads
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Suggested change
# with multiple threads

Comment thread stumpy/sdp.py

Parameters
----------
max_n : int, default=2**20
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Suggested change
max_n : int, default=2**20
max_n : int, default 2**20

Comment thread stumpy/sdp.py
real-valued array. A complex-valued array of size `1 + (max_n // 2)`
will also be preallocated.

real_dtype : str, default="float64"
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Suggested change
real_dtype : str, default="float64"
real_dtype : str, default "float64"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants