@@ -203,7 +203,7 @@ cdef cnp.ndarray _pad_array(
203
203
b_shape[axis] = n
204
204
205
205
# allocating temporary buffer
206
- x_arr_is_fortran = cnp.PyArray_CHKFLAGS(x_arr, cnp.NPY_F_CONTIGUOUS )
206
+ x_arr_is_fortran = cnp.PyArray_CHKFLAGS(x_arr, cnp.NPY_ARRAY_F_CONTIGUOUS )
207
207
b_arr = < cnp.ndarray> cnp.PyArray_EMPTY(
208
208
b_ndim, b_shape, < cnp.NPY_TYPES> b_type, x_arr_is_fortran
209
209
) # 0 for C-contiguous
@@ -249,9 +249,12 @@ cdef cnp.ndarray _process_arguments(
249
249
250
250
# convert x to ndarray, ensure that strides are multiples of itemsize
251
251
x_arr = PyArray_CheckFromAny(
252
- x, NULL , 0 , 0 ,
253
- cnp.NPY_ELEMENTSTRIDES | cnp.NPY_ENSUREARRAY | cnp.NPY_NOTSWAPPED,
254
- NULL )
252
+ x, NULL , 0 , 0 ,
253
+ cnp.NPY_ARRAY_ELEMENTSTRIDES |
254
+ cnp.NPY_ARRAY_ENSUREARRAY |
255
+ cnp.NPY_ARRAY_NOTSWAPPED,
256
+ NULL
257
+ )
255
258
256
259
if (< void * > x_arr) is NULL :
257
260
raise ValueError (" An input argument x is not an array-like object" )
@@ -319,7 +322,7 @@ cdef cnp.ndarray _allocate_result(
319
322
f_shape[axis_] = n_
320
323
321
324
# allocating output buffer
322
- x_arr_is_fortran = cnp.PyArray_CHKFLAGS(x_arr, cnp.NPY_F_CONTIGUOUS )
325
+ x_arr_is_fortran = cnp.PyArray_CHKFLAGS(x_arr, cnp.NPY_ARRAY_F_CONTIGUOUS )
323
326
f_arr = < cnp.ndarray> cnp.PyArray_EMPTY(
324
327
f_ndim, f_shape, < cnp.NPY_TYPES> f_type, x_arr_is_fortran
325
328
) # 0 for C-contiguous
@@ -419,7 +422,9 @@ def _c2c_fft1d_impl(
419
422
# so we cast to complex double and operate in place
420
423
try :
421
424
x_arr = < cnp.ndarray> cnp.PyArray_FROM_OTF(
422
- x_arr, cnp.NPY_CDOUBLE, cnp.NPY_BEHAVED | cnp.NPY_ENSURECOPY)
425
+ x_arr, cnp.NPY_CDOUBLE,
426
+ cnp.NPY_ARRAY_BEHAVED | cnp.NPY_ARRAY_ENSURECOPY
427
+ )
423
428
except :
424
429
raise ValueError (
425
430
" First argument must be a complex "
@@ -601,9 +606,9 @@ def _r2c_fft1d_impl(
601
606
else :
602
607
# we must cast the input to doubles and allocate the output,
603
608
try :
604
- requirement = cnp.NPY_BEHAVED | cnp.NPY_ENSURECOPY
609
+ requirement = cnp.NPY_ARRAY_BEHAVED | cnp.NPY_ARRAY_ENSURECOPY
605
610
if x_type is cnp.NPY_LONGDOUBLE:
606
- requirement = requirement | cnp.NPY_FORCECAST
611
+ requirement = requirement | cnp.NPY_ARRAY_FORCECAST
607
612
x_arr = < cnp.ndarray> cnp.PyArray_FROM_OTF(
608
613
x_arr, cnp.NPY_DOUBLE, requirement)
609
614
x_type = cnp.PyArray_TYPE(x_arr)
@@ -705,11 +710,11 @@ def _c2r_fft1d_impl(
705
710
# so we cast to complex double and operate in place
706
711
if x_type is cnp.NPY_FLOAT:
707
712
x_arr = < cnp.ndarray> cnp.PyArray_FROM_OTF(
708
- x_arr, cnp.NPY_CFLOAT, cnp.NPY_BEHAVED
713
+ x_arr, cnp.NPY_CFLOAT, cnp.NPY_ARRAY_BEHAVED
709
714
)
710
715
else :
711
716
x_arr = < cnp.ndarray> cnp.PyArray_FROM_OTF(
712
- x_arr, cnp.NPY_CDOUBLE, cnp.NPY_BEHAVED
717
+ x_arr, cnp.NPY_CDOUBLE, cnp.NPY_ARRAY_BEHAVED
713
718
)
714
719
x_type = cnp.PyArray_TYPE(x_arr)
715
720
in_place = 1
@@ -788,9 +793,12 @@ def _direct_fftnd(
788
793
789
794
# convert x to ndarray, ensure that strides are multiples of itemsize
790
795
x_arr = PyArray_CheckFromAny(
791
- x, NULL , 0 , 0 ,
792
- cnp.NPY_ELEMENTSTRIDES | cnp.NPY_ENSUREARRAY | cnp.NPY_NOTSWAPPED,
793
- NULL )
796
+ x, NULL , 0 , 0 ,
797
+ cnp.NPY_ARRAY_ELEMENTSTRIDES |
798
+ cnp.NPY_ARRAY_ENSUREARRAY |
799
+ cnp.NPY_ARRAY_NOTSWAPPED,
800
+ NULL
801
+ )
794
802
795
803
if < void * > x_arr is NULL :
796
804
raise ValueError (" An input argument x is not an array-like object" )
@@ -808,7 +816,9 @@ def _direct_fftnd(
808
816
pass
809
817
else :
810
818
x_arr = < cnp.ndarray> cnp.PyArray_FROM_OTF(
811
- x_arr, cnp.NPY_CDOUBLE, cnp.NPY_BEHAVED | cnp.NPY_ENSURECOPY)
819
+ x_arr, cnp.NPY_CDOUBLE,
820
+ cnp.NPY_ARRAY_BEHAVED | cnp.NPY_ARRAY_ENSURECOPY
821
+ )
812
822
x_type = cnp.PyArray_TYPE(x_arr)
813
823
assert x_type == cnp.NPY_CDOUBLE
814
824
in_place = 1
@@ -1003,7 +1013,9 @@ def _rr_fft1d_impl(x, n=None, axis=-1, overwrite_x=False, double fsc=1.0):
1003
1013
else :
1004
1014
try :
1005
1015
x_arr = < cnp.ndarray> cnp.PyArray_FROM_OTF(
1006
- x_arr, cnp.NPY_DOUBLE, cnp.NPY_BEHAVED | cnp.NPY_ENSURECOPY)
1016
+ x_arr, cnp.NPY_DOUBLE,
1017
+ cnp.NPY_ARRAY_BEHAVED | cnp.NPY_ARRAY_ENSURECOPY
1018
+ )
1007
1019
except :
1008
1020
raise TypeError (" 1st argument must be a real sequence" )
1009
1021
x_type = cnp.PyArray_TYPE(x_arr)
@@ -1065,7 +1077,9 @@ def _rr_ifft1d_impl(x, n=None, axis=-1, overwrite_x=False, double fsc=1.0):
1065
1077
# so we cast to complex double and operate in place
1066
1078
try :
1067
1079
x_arr = < cnp.ndarray> cnp.PyArray_FROM_OTF(
1068
- x_arr, cnp.NPY_DOUBLE, cnp.NPY_BEHAVED | cnp.NPY_ENSURECOPY)
1080
+ x_arr, cnp.NPY_DOUBLE,
1081
+ cnp.NPY_ARRAY_BEHAVED | cnp.NPY_ARRAY_ENSURECOPY
1082
+ )
1069
1083
except :
1070
1084
raise ValueError (
1071
1085
" First argument should be a real "
0 commit comments