You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
BUG: behavioral change of numpy.fft.rfft with numpy 2.x #26349
2.1.0.dev0+git20240423.ef5f10d
3.12.2 (main, Feb 21 2024, 00:00:00) [GCC 13.2.1 20231205 (Red Hat 13.2.1-6)]
Runtime Environment:
No response
Context for the issue:
Difference found while porting pythran to numpy 2.x, as pythran mimics the 'legacy' behavior.
I'm unsure whether the new behavior is intended or not, at least it's not documented in the git log as far as I can tell (?)
@mhvk is maybe another one of those "FFT seems simple but is not?" off-by-one errors. I think the SciPy fft returns the same as NumPy used to here, so it seems plausible (didn't try to understand yet what is going on, maybe it makes sense).
Activity
[Numpy 2.x] Skip some rfft compatibility test
seberg commentedon Apr 26, 2024
@mhvk is maybe another one of those "FFT seems simple but is not?" off-by-one errors. I think the SciPy fft returns the same as NumPy used to here, so it seems plausible (didn't try to understand yet what is going on, maybe it makes sense).
whym1here commentedon Apr 26, 2024
Is this intended behavior?
WarrenWeckesser commentedon Apr 26, 2024
@whym1here, no, it is a bug. When
nis even, the imaginary part of the last coefficient returned byrfftmust be zero.The equivalent calculation using
fftisWarrenWeckesser commentedon Apr 26, 2024
I have a possible fix in #26354.
pijyoi commentedon Apr 27, 2024
There's an over-copy of the 5th input element when only a shorter length fft was required.
BUG: Fix rfft for even input length.
BUG: Fix rfft for even input length.
serge-sans-paille commentedon Apr 27, 2024
[Numpy 2.x] Skip some rfft compatibility test