Skip to content

Commit

Permalink
Merge pull request pyFFTW#207 from grlee77/rfftfreq
Browse files Browse the repository at this point in the history
add rfftfreq to the numpy interfaces
grlee77 authored Feb 9, 2018
2 parents 3f8a6c7 + 6a57cbe commit f11944a
Showing 2 changed files with 13 additions and 1 deletion.
10 changes: 9 additions & 1 deletion pyfftw/interfaces/numpy_fft.py
Original file line number Diff line number Diff line change
@@ -64,12 +64,20 @@

# Complete the namespace (these are not actually used in this module)
from numpy.fft import fftfreq, fftshift, ifftshift

import numpy

__all__ = ['fft','ifft', 'fft2', 'ifft2', 'fftn', 'ifftn',
__all__ = ['fft', 'ifft', 'fft2', 'ifft2', 'fftn', 'ifftn',
'rfft', 'irfft', 'rfft2', 'irfft2', 'rfftn', 'irfftn',
'hfft', 'ihfft', 'fftfreq', 'fftshift', 'ifftshift']

try:
# rfftfreq was added to the namespace in numpy 1.8
from numpy.fft import rfftfreq
__all__ += ['rfftfreq', ]
except ImportError:
pass


def fft(a, n=None, axis=-1, norm=None, overwrite_input=False,
planner_effort='FFTW_ESTIMATE', threads=1,
4 changes: 4 additions & 0 deletions test/test_pyfftw_numpy_interface.py
Original file line number Diff line number Diff line change
@@ -132,6 +132,10 @@ def rfft2_fix(a, s=None, axes=(-2, -1), norm=None):

acquired_names = ('fftfreq', 'fftshift', 'ifftshift')

if LooseVersion(numpy.version.version) >= LooseVersion('1.8'):
acquired_names += ('rfftfreq', )


class InterfacesNumpyFFTTestModule(unittest.TestCase):
''' A really simple test suite to check the module works as expected.
'''

0 comments on commit f11944a

Please sign in to comment.