Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use scipy's convolve for snip1d #630

Merged
merged 1 commit into from
Apr 12, 2024
Merged

Use scipy's convolve for snip1d #630

merged 1 commit into from
Apr 12, 2024

Conversation

psavery
Copy link
Collaborator

@psavery psavery commented Apr 11, 2024

According to the scipy documentation, convolve will automatically pick which method to use depending on which method it thinks will be faster.

We were forcing it to use fftconvolve before, which, for our example, took about 1.588 seconds to run. Switching to convolve now takes about 0.468 seconds instead, so it is noticeably faster.

In our example, the final snip1d result had a max difference of 2.6e-13 compared to using fftconvolve, so it appears to have a minimal impact on the results.

According to the [scipy documentation](https://docs.scipy.org/doc/scipy/reference/generated/scipy.signal.convolve.html#scipy.signal.convolve), convolve
will automatically pick which method to use depending on which method
it thinks will be faster.

We were forcing it to use `fftconvolve` before, which, for our example,
took about 1.588 seconds to run. Switching to `convolve` now takes about
0.468 seconds instead, so it is noticeably faster.

In our example, the final snip1d result had a max difference of
`2.6e-13` compared to using `fftconvolve`, so it appears to have a
minimal impact on the results.

Signed-off-by: Patrick Avery <patrick.avery@kitware.com>
@psavery psavery requested a review from saransh13 April 11, 2024 20:58
Copy link
Member

@saransh13 saransh13 left a comment

Choose a reason for hiding this comment

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

LGTM

@saransh13 saransh13 merged commit 545cf36 into master Apr 12, 2024
6 checks passed
@psavery psavery deleted the snip1d-convolve branch April 25, 2024 19:27
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