Skip to content

Commit 3121b76

Browse files
authored
Merge pull request #233 from IntelPython/revert-gh-229-scipy-vendoring
Revert vendoring of SciPy functions
2 parents b466be8 + fc12a0d commit 3121b76

File tree

6 files changed

+62
-97
lines changed

6 files changed

+62
-97
lines changed

CHANGELOG.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
## [2.1.1] - 2025-10-09
8+
9+
### Fixed
10+
* Fix a circular dependency in Intel NumPy: revert vendoring of `scipy.fft` functions, instead using thin wrappers to call from `scipy` directly [gh-233](https://github.com/IntelPython/mkl_fft/pull/233)
11+
712
## [2.1.0] - 2025-10-06
813

914
### Added
@@ -14,7 +19,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1419
* Dropped support for `overwrite_x` parameter in `mkl_fft` [gh-185](https://github.com/IntelPython/mkl_fft/pull/185)
1520
* Replaced `fwd_scale` parameter with `norm` in `mkl_fft` [gh-189](https://github.com/IntelPython/mkl_fft/pull/189)
1621
* Conditionally import `scipy_fft` only if `scipy` is installed [gh-195](https://github.com/IntelPython/mkl_fft/pull/195)
17-
* Added thin wrappers for `fftfreq`, `rfftfreq`, `fftshift`, and `ifftshift` to `scipy_fft` and `numpy_fft` interfaces [gh-226](https://github.com/IntelPython/mkl_fft/pull/226), [gh=229](https://github.com/IntelPython/mkl_fft/pull/229)
22+
* Vendor `fftfreq`, `rfftfreq`, `fftshift`, and `ifftshift` to `scipy_fft` and `numpy_fft` interfaces [gh-226](https://github.com/IntelPython/mkl_fft/pull/226), [gh=229](https://github.com/IntelPython/mkl_fft/pull/229)
1823

1924
### Fixed
2025
* Fixed a bug for N-D FFTs when both `s` and `out` are given [gh-185](https://github.com/IntelPython/mkl_fft/pull/185)

conda-recipe-cf/meta.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{% set version = "2.1.0" %}
1+
{% set version = "2.1.1" %}
22
{% set buildnumber = 0 %}
33

44
package:

mkl_fft/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "2.1.0"
1+
__version__ = "2.1.1"

mkl_fft/interfaces/_scipy_fft.py

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636

3737
import mkl
3838
import numpy as np
39+
import scipy
3940

4041
import mkl_fft
4142

@@ -61,6 +62,10 @@
6162
"ihfft2",
6263
"hfftn",
6364
"ihfftn",
65+
"fftshift",
66+
"ifftshift",
67+
"fftfreq",
68+
"rfftfreq",
6469
"get_workers",
6570
"set_workers",
6671
]
@@ -650,6 +655,51 @@ def ihfftn(
650655
return result
651656

652657

658+
# define thin wrappers for scipy functions to avoid circular dependencies
659+
def fftfreq(n, d=1.0, *, xp=None, device=None):
660+
"""
661+
Return the Discrete Fourier Transform sample frequencies.
662+
663+
For full documentation refer to `scipy.fft.fftfreq`.
664+
665+
"""
666+
return scipy.fft.fftfreq(n, d=d, xp=xp, device=device)
667+
668+
669+
def rfftfreq(n, d=1.0, *, xp=None, device=None):
670+
"""
671+
Return the Discrete Fourier Transform sample frequencies (for usage with
672+
`rfft`, `irfft`).
673+
674+
For full documentation refer to `scipy.fft.rfftfreq`.
675+
676+
"""
677+
return scipy.fft.rfftfreq(n, d=d, xp=xp, device=device)
678+
679+
680+
def fftshift(x, axes=None):
681+
"""
682+
Shift the zero-frequency component to the center of the spectrum.
683+
684+
For full documentation refer to `scipy.fft.fftshift`.
685+
686+
"""
687+
from scipy.fft import fftshift
688+
689+
return fftshift(x, axes=axes)
690+
691+
692+
def ifftshift(x, axes=None):
693+
"""
694+
The inverse of `fftshift`. Although identical for even-length `x`, the
695+
functions differ by one sample for odd-length `x`.
696+
697+
For full documentation refer to `scipy.fft.ifftshift`.
698+
699+
"""
700+
return scipy.fft.ifftshift(x, axes=axes)
701+
702+
653703
def get_workers():
654704
"""
655705
Gets the number of workers used by mkl_fft by default.

mkl_fft/interfaces/_scipy_helper.py

Lines changed: 0 additions & 93 deletions
This file was deleted.

mkl_fft/interfaces/scipy_fft.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,17 @@
2828
from ._scipy_fft import (
2929
fft,
3030
fft2,
31+
fftfreq,
3132
fftn,
33+
fftshift,
3234
get_workers,
3335
hfft,
3436
hfft2,
3537
hfftn,
3638
ifft,
3739
ifft2,
3840
ifftn,
41+
ifftshift,
3942
ihfft,
4043
ihfft2,
4144
ihfftn,
@@ -44,10 +47,10 @@
4447
irfftn,
4548
rfft,
4649
rfft2,
50+
rfftfreq,
4751
rfftn,
4852
set_workers,
4953
)
50-
from ._scipy_helper import fftfreq, fftshift, ifftshift, rfftfreq
5154

5255
__all__ = [
5356
"fft",

0 commit comments

Comments
 (0)