-
Notifications
You must be signed in to change notification settings - Fork 110
scipy.fft interface #269
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
scipy.fft interface #269
Conversation
The CI failure here is unrelated (it seems availability of some conda packages for Python 2.7 have changed). It may be time to just drop Python 2.7 support on master rather than try to fix this, but I will open a separate issue for that. |
Once uarray backend support has been added here, please also revise the following section of the docs: |
|
What're the uarray changes? I'm a bit out of touch on this... |
It was just merged into scipy today (scipy/scipy#10383). It means you can provide the implementation for the functions in import scipy.fft
scipy.fft.fft([1]) # Calls scipy's own implementation
from pyfftw.interfaces import scipy_fft
scipy.fft.set_global_backend(scipy_fft)
scipy.fft.fft([1]) # Calls into pyfftw See the |
6a3b487
to
8230ba4
Compare
It looks like the scipy dev wheels are built weekly so this test will continue to fail until sometime next week. It passes for me locally though. |
Does this break without the latest scipy? Is it only this set backend bit? |
The only issue is that the symbol |
And of course if |
I think I'd prefer the import code to inspect the scipy version to make it explicit for future reading ( |
Done
Unfortunately the weekly builds are only identified by part of a commit hash so ordered comparison isn't really possible.
Yes, it's currently on 1.4.0.dev0 while the released version is 1.3.0 |
Doesn't the version convey the information? I thought the api changes was 1.3 -> 1.4? |
Yes, for release versions that will be sufficient but 1.4 hasn't been released yet. |
Do the comparisons not work on dev releases? I was under the impression the semantic versioning was meant to allow precisely these sort of comparisons... |
The dev versions are like |
Ah I see. Anyway, it looks fine to me. The problem at the moment then is that is breaks against dev releases, but should work find on non-dev versions? |
Yes, it's only an issue with 1.4.0dev versions from before the uarray features were added. Notice that on travis everything else is passing. |
Ok, in that case let's wait for the weekly release and then merge. |
Nice work by the way :) |
@peterbell10 if it makes life easier for this backend work we can probably increment the |
Unfortunately |
The new wheels are out and the tests are now passing. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me with only minor comments to address
docs/source/tutorial.rst
Outdated
Time with scipy.fftpack: 0.598 seconds | ||
Time with monkey patched scipy_fftpack: 0.251 seconds | ||
Time with scipy.fft default backend: 0.598 seconds | ||
Time with pyfftw backend installed: 0.251 seconds |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you update the numbers here? I am curious if the ratio is currently still similar to that seen here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The gap has closed slightly but I think the main advantage pyfftw has now is multithreading.
@hgomersall, If these changes look good to you I think we are done here. |
Closes #268
Since the
scipy.fft
interface matchesnumpy.fft
very closely, this is simple enough to implement. The exception is the n-dimensionalhfft
s which would require more work than the 1dhfft
in the numpy interface