Skip to content

Commit 69defde

Browse files
authored
update functions name (#137)
1 parent ccc838a commit 69defde

File tree

9 files changed

+491
-492
lines changed

9 files changed

+491
-492
lines changed

mkl_fft/__init__.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@
2424
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
2525
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2626

27-
from ._pydfti import (fft, ifft, fft2, ifft2, fftn, ifftn, rfft, irfft,
28-
rfft_numpy, irfft_numpy, rfftn_numpy, irfftn_numpy)
27+
from ._pydfti import (fft, ifft, fft2, ifft2, fftn, ifftn, rfftpack, irfftpack,
28+
rfft, irfft, rfft2, irfft2, rfftn, irfftn)
2929

3030
from ._version import __version__
3131
import mkl_fft.interfaces
3232

33-
__all__ = ['fft', 'ifft', 'fft2', 'ifft2', 'fftn', 'ifftn', 'rfft', 'irfft',
34-
'rfft_numpy', 'irfft_numpy', 'rfftn_numpy', 'irfftn_numpy', 'interfaces']
33+
__all__ = ['fft', 'ifft', 'fft2', 'ifft2', 'fftn', 'ifftn', 'rfftpack', 'irfftpack'
34+
'rfft', 'irfft', 'rfft2', 'irfft2', 'rfftn', 'irfftn','interfaces']

mkl_fft/_numpy_fft.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ def rfft(a, n=None, axis=-1, norm=None):
406406
fsc = ortho_sc_1d(n, x.shape[axis])
407407

408408
return trycall(
409-
mkl_fft.rfft_numpy,
409+
mkl_fft.rfft,
410410
(x,),
411411
{'n': n, 'axis': axis,
412412
'fwd_scale': fsc})
@@ -510,7 +510,7 @@ def irfft(a, n=None, axis=-1, norm=None):
510510
fsc = ortho_sc_1d(nn, nn)
511511

512512
return trycall(
513-
mkl_fft.irfft_numpy,
513+
mkl_fft.irfft,
514514
(x,),
515515
{'n': n, 'axis': axis,
516516
'fwd_scale': fsc})
@@ -606,7 +606,7 @@ def hfft(a, n=None, axis=-1, norm=None):
606606
fsc = ortho_sc_1d(nn, nn)
607607

608608
return trycall(
609-
mkl_fft.irfft_numpy,
609+
mkl_fft.irfft,
610610
(x,),
611611
{'n': n, 'axis': axis,
612612
'fwd_scale': fsc})
@@ -682,7 +682,7 @@ def ihfft(a, n=None, axis=-1, norm=None):
682682
fsc = ortho_sc_1d(n, x.shape[axis])
683683

684684
output = trycall(
685-
mkl_fft.rfft_numpy,
685+
mkl_fft.rfft,
686686
(x,),
687687
{'n': n, 'axis': axis,
688688
'fwd_scale': fsc})
@@ -1237,7 +1237,7 @@ def rfftn(a, s=None, axes=None, norm=None):
12371237
fsc = sqrt(frwd_sc_nd(s, axes, x.shape))
12381238

12391239
return trycall(
1240-
mkl_fft.rfftn_numpy,
1240+
mkl_fft.rfftn,
12411241
(x,),
12421242
{'s': s, 'axes': axes,
12431243
'fwd_scale': fsc})
@@ -1394,7 +1394,7 @@ def irfftn(a, s=None, axes=None, norm=None):
13941394
fsc = sqrt(frwd_sc_nd(s, axes, x.shape))
13951395

13961396
return trycall(
1397-
mkl_fft.irfftn_numpy,
1397+
mkl_fft.irfftn,
13981398
(x,),
13991399
{'s': s, 'axes': axes,
14001400
'fwd_scale': fsc})

mkl_fft/_pydfti.pyx

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -408,12 +408,12 @@ def _fft1d_impl(x, n=None, axis=-1, overwrite_arg=False, direction=+1, double fs
408408
return f_arr
409409

410410

411-
def rfft(x, n=None, axis=-1, overwrite_x=False, fwd_scale=1.0):
411+
def rfftpack(x, n=None, axis=-1, overwrite_x=False, fwd_scale=1.0):
412412
"""Packed real-valued harmonics of FFT of a real sequence x"""
413413
return _rr_fft1d_impl2(x, n=n, axis=axis, overwrite_arg=overwrite_x, fsc=fwd_scale)
414414

415415

416-
def irfft(x, n=None, axis=-1, overwrite_x=False, fwd_scale=1.0):
416+
def irfftpack(x, n=None, axis=-1, overwrite_x=False, fwd_scale=1.0):
417417
"""Inverse FFT of a real sequence, takes packed real-valued harmonics of FFT"""
418418
return _rr_ifft1d_impl2(x, n=n, axis=axis, overwrite_arg=overwrite_x, fsc=fwd_scale)
419419

@@ -524,7 +524,7 @@ def _rr_fft1d_impl2(x, n=None, axis=-1, overwrite_arg=False, double fsc=1.0):
524524
"""
525525
Uses MKL to perform real packed 1D FFT on the input array x along the given axis.
526526
527-
This done by using rfft_numpy and post-processing the result.
527+
This done by using rfft and post-processing the result.
528528
Thus overwrite_arg is effectively discarded.
529529
530530
Functionally equivalent to scipy.fftpack.rfft
@@ -580,7 +580,7 @@ def _rr_ifft1d_impl2(x, n=None, axis=-1, overwrite_arg=False, double fsc=1.0):
580580
"""
581581
Uses MKL to perform real packed 1D FFT on the input array x along the given axis.
582582
583-
This done by using rfft_numpy and post-processing the result.
583+
This done by using rfft and post-processing the result.
584584
Thus overwrite_arg is effectively discarded.
585585
586586
Functionally equivalent to scipy.fftpack.irfft
@@ -793,11 +793,11 @@ def _rc_ifft1d_impl(x, n=None, axis=-1, overwrite_arg=False, double fsc=1.0):
793793
return f_arr
794794

795795

796-
def rfft_numpy(x, n=None, axis=-1, fwd_scale=1.0):
796+
def rfft(x, n=None, axis=-1, fwd_scale=1.0):
797797
return _rc_fft1d_impl(x, n=n, axis=axis, fsc=fwd_scale)
798798

799799

800-
def irfft_numpy(x, n=None, axis=-1, fwd_scale=1.0):
800+
def irfft(x, n=None, axis=-1, fwd_scale=1.0):
801801
return _rc_ifft1d_impl(x, n=n, axis=axis, fsc=fwd_scale)
802802

803803

@@ -1121,12 +1121,12 @@ def ifftn(x, shape=None, axes=None, overwrite_x=False, fwd_scale=1.0):
11211121
return _fftnd_impl(x, shape=shape, axes=axes, overwrite_x=overwrite_x, direction=-1, fsc=fwd_scale)
11221122

11231123

1124-
def rfft2_numpy(x, s=None, axes=(-2,-1), fwd_scale=1.0):
1125-
return rfftn_numpy(x, s=s, axes=axes, fsc=fwd_scale)
1124+
def rfft2(x, s=None, axes=(-2,-1), fwd_scale=1.0):
1125+
return rfftn(x, s=s, axes=axes, fsc=fwd_scale)
11261126

11271127

1128-
def irfft2_numpy(x, s=None, axes=(-2,-1), fwd_scale=1.0):
1129-
return irfftn_numpy(x, s=s, axes=axes, fsc=fwd_scale)
1128+
def irfft2(x, s=None, axes=(-2,-1), fwd_scale=1.0):
1129+
return irfftn(x, s=s, axes=axes, fsc=fwd_scale)
11301130

11311131

11321132
def _remove_axis(s, axes, axis_to_remove):
@@ -1181,16 +1181,15 @@ def _fix_dimensions(cnp.ndarray arr, object s, object axes):
11811181
return np.pad(arr, tuple(pad_widths), 'constant')
11821182

11831183

1184-
def rfftn_numpy(x, s=None, axes=None, fwd_scale=1.0):
1184+
def rfftn(x, s=None, axes=None, fwd_scale=1.0):
11851185
a = np.asarray(x)
11861186
no_trim = (s is None) and (axes is None)
11871187
s, axes = _cook_nd_args(a, s, axes)
11881188
la = axes[-1]
1189-
# trim array, so that rfft_numpy avoids doing
1190-
# unnecessary computations
1189+
# trim array, so that rfft avoids doing unnecessary computations
11911190
if not no_trim:
11921191
a = _trim_array(a, s, axes)
1193-
a = rfft_numpy(a, n = s[-1], axis=la, fwd_scale=fwd_scale)
1192+
a = rfft(a, n = s[-1], axis=la, fwd_scale=fwd_scale)
11941193
if len(s) > 1:
11951194
if not no_trim:
11961195
ss = list(s)
@@ -1214,7 +1213,7 @@ def rfftn_numpy(x, s=None, axes=None, fwd_scale=1.0):
12141213
return a
12151214

12161215

1217-
def irfftn_numpy(x, s=None, axes=None, fwd_scale=1.0):
1216+
def irfftn(x, s=None, axes=None, fwd_scale=1.0):
12181217
a = np.asarray(x)
12191218
no_trim = (s is None) and (axes is None)
12201219
s, axes = _cook_nd_args(a, s, axes, invreal=True)
@@ -1243,5 +1242,5 @@ def irfftn_numpy(x, s=None, axes=None, fwd_scale=1.0):
12431242
for ii in range(len(axes)-1):
12441243
a = ifft(a, s[ii], axes[ii], overwrite_x=ovr_x)
12451244
ovr_x = True
1246-
a = irfft_numpy(a, n = s[-1], axis=la, fwd_scale=fwd_scale)
1245+
a = irfft(a, n = s[-1], axis=la, fwd_scale=fwd_scale)
12471246
return a

0 commit comments

Comments
 (0)