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
In numpy/numpy#13357, @mreineck notes that numpy.irfft will fail for inputs of length 1 because the default size of 2*(len-1) is 0. The alternative default is 2*len - 1 which will never truncate the input array.
The current behaviour loses information: rfft(irfft(x)) != x for all inputs. In general, it is a bad idea to use irfft without specifying the size and will only behave properly for even length inputs.
scipy.fft will of course have to match numpy.fft, so any change in behavior needs to be coordinated. Possibly by deprecating the default value, or at least providing a warning.
The text was updated successfully, but these errors were encountered:
scipy.fft will of course have to match numpy.fft, so any change in behavior needs to be coordinated. Possibly by deprecating the default value, or at least providing a warning.
If the behavior is bad for length 1 arrays and, more importantly, odd-length arrays then I think it's fine to deviate from numpy I'd say. I suggest to open a doc PR for numpy at least. That will get us some feedback on whether numpy wants to just document or deprecate some behavior.
Related to #10238
In numpy/numpy#13357, @mreineck notes that
numpy.irfft
will fail for inputs of length 1 because the default size of2*(len-1)
is 0. The alternative default is2*len - 1
which will never truncate the input array.The current behaviour loses information:
rfft(irfft(x)) != x
for all inputs. In general, it is a bad idea to useirfft
without specifying the size and will only behave properly for even length inputs.scipy.fft
will of course have to matchnumpy.fft
, so any change in behavior needs to be coordinated. Possibly by deprecating the default value, or at least providing a warning.The text was updated successfully, but these errors were encountered: