summaryrefslogtreecommitdiff
path: root/numpy/fft
diff options
context:
space:
mode:
authorStephan Hoyer <shoyer@google.com>2018-10-23 07:53:58 -0700
committerStephan Hoyer <shoyer@google.com>2018-10-23 07:57:40 -0700
commit8bab96faf2cb740536712e49e92e133626087018 (patch)
treeb16d0f4d121d588ca3219b95d3c4304059cddacd /numpy/fft
parent42a5bddc937ef02175d52a3ab3b3da6229e1ecb2 (diff)
downloadnumpy-8bab96faf2cb740536712e49e92e133626087018.tar.gz
MAINT: set preferred __module__ for numpy functions
Diffstat (limited to 'numpy/fft')
-rw-r--r--numpy/fft/fftpack.py8
-rw-r--r--numpy/fft/helper.py4
2 files changed, 9 insertions, 3 deletions
diff --git a/numpy/fft/fftpack.py b/numpy/fft/fftpack.py
index d88990373..de675936f 100644
--- a/numpy/fft/fftpack.py
+++ b/numpy/fft/fftpack.py
@@ -35,10 +35,12 @@ from __future__ import division, absolute_import, print_function
__all__ = ['fft', 'ifft', 'rfft', 'irfft', 'hfft', 'ihfft', 'rfftn',
'irfftn', 'rfft2', 'irfft2', 'fft2', 'ifft2', 'fftn', 'ifftn']
+import functools
+
from numpy.core import (array, asarray, zeros, swapaxes, shape, conjugate,
take, sqrt)
from numpy.core.multiarray import normalize_axis_index
-from numpy.core.overrides import array_function_dispatch
+from numpy.core import overrides
from . import fftpack_lite as fftpack
from .helper import _FFTCache
@@ -46,6 +48,10 @@ _fft_cache = _FFTCache(max_size_in_mb=100, max_item_count=32)
_real_fft_cache = _FFTCache(max_size_in_mb=100, max_item_count=32)
+array_function_dispatch = functools.partial(
+ overrides.array_function_dispatch, module='numpy.fft')
+
+
def _raw_fft(a, n=None, axis=-1, init_function=fftpack.cffti,
work_function=fftpack.cfftf, fft_cache=_fft_cache):
a = asarray(a)
diff --git a/numpy/fft/helper.py b/numpy/fft/helper.py
index 4b698bb4d..e65883651 100644
--- a/numpy/fft/helper.py
+++ b/numpy/fft/helper.py
@@ -24,7 +24,7 @@ def _fftshift_dispatcher(x, axes=None):
return (x,)
-@array_function_dispatch(_fftshift_dispatcher)
+@array_function_dispatch(_fftshift_dispatcher, module='numpy.fft')
def fftshift(x, axes=None):
"""
Shift the zero-frequency component to the center of the spectrum.
@@ -81,7 +81,7 @@ def fftshift(x, axes=None):
return roll(x, shift, axes)
-@array_function_dispatch(_fftshift_dispatcher)
+@array_function_dispatch(_fftshift_dispatcher, module='numpy.fft')
def ifftshift(x, axes=None):
"""
The inverse of `fftshift`. Although identical for even-length `x`, the