Skip to content

Commit d9e9a75

Browse files
committed
Merge branch 'master' into raise-warning
2 parents eb1ab83 + 87ef5fb commit d9e9a75

File tree

11 files changed

+166
-99
lines changed

11 files changed

+166
-99
lines changed

Diff for: conda-recipe-cf/meta.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{% set version = "1.3.11" %}
1+
{% set version = "1.3.13" %}
22
{% set buildnumber = 0 %}
33

44
package:

Diff for: conda-recipe/meta.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{% set version = "1.3.11" %}
1+
{% set version = "1.3.13" %}
22
{% set buildnumber = 0 %}
33

44
package:

Diff for: mkl_fft/__init__.py

+3
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
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 . import _init_helper
2728
from ._pydfti import (fft, ifft, fft2, ifft2, fftn, ifftn, rfftpack, irfftpack,
2829
rfft, irfft, rfft2, irfft2, rfftn, irfftn)
2930

@@ -32,3 +33,5 @@
3233

3334
__all__ = ['fft', 'ifft', 'fft2', 'ifft2', 'fftn', 'ifftn', 'rfftpack', 'irfftpack'
3435
'rfft', 'irfft', 'rfft2', 'irfft2', 'rfftn', 'irfftn','interfaces']
36+
37+
del _init_helper

Diff for: mkl_fft/_init_helper.py

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Copyright 2025 Intel Corporation
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
import os
16+
import os.path
17+
import sys
18+
19+
is_venv_win32 = (
20+
sys.platform == "win32"
21+
and sys.base_exec_prefix != sys.exec_prefix
22+
and os.path.isfile(os.path.join(sys.exec_prefix, "pyvenv.cfg"))
23+
)
24+
25+
if is_venv_win32:
26+
# In Windows venv: add Library/bin to PATH for proper DLL loading
27+
dll_dir = os.path.join(sys.exec_prefix, "Library", "bin")
28+
if os.path.isdir(dll_dir):
29+
os.add_dll_directory(dll_dir)
30+
31+
del is_venv_win32

Diff for: mkl_fft/_numpy_fft.py

+13-16
Original file line numberDiff line numberDiff line change
@@ -72,16 +72,13 @@ def _check_norm(norm):
7272

7373

7474
def frwd_sc_1d(n, s):
75-
nn = n if n else s
75+
nn = n if n is not None else s
7676
return 1/nn if nn != 0 else 1
7777

7878

79-
def frwd_sc_nd(s, axes, x_shape):
79+
def frwd_sc_nd(s, x_shape):
8080
ss = s if s is not None else x_shape
81-
if axes is not None:
82-
nn = prod([ss[ai] for ai in axes])
83-
else:
84-
nn = prod(ss)
81+
nn = prod(ss)
8582
return 1/nn if nn != 0 else 1
8683

8784

@@ -837,14 +834,14 @@ def fftn(a, s=None, axes=None, norm=None):
837834
if norm in (None, "backward"):
838835
fsc = 1.0
839836
elif norm == "forward":
840-
fsc = frwd_sc_nd(s, axes, x.shape)
837+
fsc = frwd_sc_nd(s, x.shape)
841838
else:
842-
fsc = sqrt(frwd_sc_nd(s, axes, x.shape))
839+
fsc = sqrt(frwd_sc_nd(s, x.shape))
843840

844841
return trycall(
845842
mkl_fft.fftn,
846843
(x,),
847-
{'shape': s, 'axes': axes,
844+
{'s': s, 'axes': axes,
848845
'fwd_scale': fsc})
849846

850847

@@ -954,14 +951,14 @@ def ifftn(a, s=None, axes=None, norm=None):
954951
if norm in (None, "backward"):
955952
fsc = 1.0
956953
elif norm == "forward":
957-
fsc = frwd_sc_nd(s, axes, x.shape)
954+
fsc = frwd_sc_nd(s, x.shape)
958955
else:
959-
fsc = sqrt(frwd_sc_nd(s, axes, x.shape))
956+
fsc = sqrt(frwd_sc_nd(s, x.shape))
960957

961958
return trycall(
962959
mkl_fft.ifftn,
963960
(x,),
964-
{'shape': s, 'axes': axes,
961+
{'s': s, 'axes': axes,
965962
'fwd_scale': fsc})
966963

967964

@@ -1253,10 +1250,10 @@ def rfftn(a, s=None, axes=None, norm=None):
12531250
fsc = 1.0
12541251
elif norm == "forward":
12551252
x = asanyarray(x)
1256-
fsc = frwd_sc_nd(s, axes, x.shape)
1253+
fsc = frwd_sc_nd(s, x.shape)
12571254
else:
12581255
x = asanyarray(x)
1259-
fsc = sqrt(frwd_sc_nd(s, axes, x.shape))
1256+
fsc = sqrt(frwd_sc_nd(s, x.shape))
12601257

12611258
return trycall(
12621259
mkl_fft.rfftn,
@@ -1408,10 +1405,10 @@ def irfftn(a, s=None, axes=None, norm=None):
14081405
fsc = 1.0
14091406
elif norm == "forward":
14101407
x = asanyarray(x)
1411-
fsc = frwd_sc_nd(s, axes, x.shape)
1408+
fsc = frwd_sc_nd(s, x.shape)
14121409
else:
14131410
x = asanyarray(x)
1414-
fsc = sqrt(frwd_sc_nd(s, axes, x.shape))
1411+
fsc = sqrt(frwd_sc_nd(s, x.shape))
14151412

14161413
return trycall(
14171414
mkl_fft.irfftn,

0 commit comments

Comments
 (0)