array-api-compat
array-api-compat copied to clipboard
Wrap fft for dask
There's some failures relating to the expected dtype on older numpy versions.
The wrappers in common should already be handling the dtype difference. It looks like the norm keyword isn't working, though.
Going to pick this up again this week.
Thanks for not closing.
This should be ready for a look now.
Tests are passing with dask main. (this should be mergeable whenever dask cuts its next release).
Does dask still require the wrappers here? The only thing they do for NumPy is fix upcasting for 32-bit types, which has been fixed in NumPy 2.0. If the next version of dask has the NumPy 2.0 behavior then no wrapping is necessary at all.
Ah thanks, I'll go and wrap that.
Curious why it's only on fftfreq and not on fft
fftfreq creates an array from scalar inputs, so there is no device to infer.
fft takes arrays as input so can infer the device.
I think I was actually wrapping stuff incorrectly all this time (I forgot to import the wrappers in init)
I'm going to give only wrapping fftfreq/rfftfreq a shot.
@asmeurer This should be ready for a look now.
Sorry for the long delay, had to wrangle with Github Actions/the __all__ tests for a while.
This looks good, and I think the existing tests should be checking all the code that's been added here, so if tests are passing I'm reasonably confident this is all correct.