Skip to content

Commit 83b6581

Browse files
committed
update handling shape and axes of scipy interface
1 parent 2eb3cfc commit 83b6581

File tree

4 files changed

+83
-92
lines changed

4 files changed

+83
-92
lines changed

.github/workflows/conda-package.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,8 @@ jobs:
131131
- name: Install mkl_fft
132132
run: |
133133
CHANNELS="-c $GITHUB_WORKSPACE/channel ${{ env.CHANNELS }}"
134-
conda create -n ${{ env.TEST_ENV_NAME }} python=${{ matrix.python }} $PACKAGE_NAME pytest scipy $CHANNELS
134+
conda create -n ${{ env.TEST_ENV_NAME }} python=${{ matrix.python }} "scipy>=1.10" $CHANNELS
135+
conda install -n ${{ env.TEST_ENV_NAME }} $PACKAGE_NAME pytest $CHANNELS
135136
# Test installed packages
136137
conda list -n ${{ env.TEST_ENV_NAME }}
137138
@@ -295,15 +296,16 @@ jobs:
295296
FOR /F "tokens=* USEBACKQ" %%F IN (`python -c "%SCRIPT%"`) DO (
296297
SET PACKAGE_VERSION=%%F
297298
)
298-
SET "TEST_DEPENDENCIES=pytest pytest-cov"
299-
conda install -n ${{ env.TEST_ENV_NAME }} ${{ env.PACKAGE_NAME }}=%PACKAGE_VERSION% %TEST_DEPENDENCIES% python=${{ matrix.python }} scipy -c ${{ env.workdir }}/channel ${{ env.CHANNELS }}
299+
SET "TEST_DEPENDENCIES=pytest scipy"
300+
conda install -n ${{ env.TEST_ENV_NAME }} ${{ env.PACKAGE_NAME }}=%PACKAGE_VERSION% %TEST_DEPENDENCIES% python=${{ matrix.python }} -c ${{ env.workdir }}/channel ${{ env.CHANNELS }}
300301
301302
- name: Report content of test environment
302303
shell: cmd /C CALL {0}
303304
run: |
304305
echo "Value of CONDA environment variable was: " %CONDA%
305306
echo "Value of CONDA_PREFIX environment variable was: " %CONDA_PREFIX%
306307
conda info && conda list -n ${{ env.TEST_ENV_NAME }}
308+
307309
- name: Run tests
308310
shell: cmd /C CALL {0}
309311
run: >-

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1111
* Added support for `out` kwarg to all FFT functions in `mkl_fft` and `mkl_fft.interfaces.numpy_fft` [gh-157](https://github.com/IntelPython/mkl_fft/pull/157)
1212

1313
### Changed
14-
* NumPy interface `mkl_fft.interfaces.numpy_fft` is aligned with numpy-2.* [gh-139](https://github.com/IntelPython/mkl_fft/pull/139), [gh-157](https://github.com/IntelPython/mkl_fft/pull/157)
14+
* NumPy interface `mkl_fft.interfaces.numpy_fft` is aligned with numpy-2.x.x [gh-139](https://github.com/IntelPython/mkl_fft/pull/139), [gh-157](https://github.com/IntelPython/mkl_fft/pull/157)
15+
* SciPy interface `mkl_fft.interfaces.scipy_fft` uses the same function from SciPy for handling `s` and `axes` for N-D FFTs[gh-181](https://github.com/IntelPython/mkl_fft/pull/181)
1516

1617
## [1.3.14] (04/10/2025)
1718

mkl_fft/_pydfti.pyx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ def _tls_dfti_cache_capsule():
8989
cdef extern from "Python.h":
9090
ctypedef int size_t
9191

92-
long PyInt_AsLong(object ob)
92+
long PyLong_AsLong(object ob)
9393
int PyObject_HasAttrString(object, char*)
9494

9595

@@ -262,7 +262,7 @@ cdef cnp.ndarray _process_arguments(
262262
xnd[0] = cnp.PyArray_NDIM(x_arr) # tensor-rank of the array
263263

264264
err = 0
265-
axis_[0] = PyInt_AsLong(axis)
265+
axis_[0] = PyLong_AsLong(axis)
266266
if (axis_[0] == -1 and PyErr_Occurred()):
267267
PyErr_Clear()
268268
err = 1
@@ -278,7 +278,7 @@ cdef cnp.ndarray _process_arguments(
278278
n_[0] = x_arr.shape[axis_[0]]
279279
else:
280280
try:
281-
n_[0] = PyInt_AsLong(n)
281+
n_[0] = PyLong_AsLong(n)
282282
except:
283283
err = 1
284284

@@ -334,7 +334,7 @@ cdef int _is_integral(object num):
334334
if num is None:
335335
return 0
336336
try:
337-
n = PyInt_AsLong(num)
337+
n = PyLong_AsLong(num)
338338
_integral = 1 if n > 0 else 0
339339
except:
340340
_integral = 0

0 commit comments

Comments
 (0)