From 81103008ef68d56200699cb24ff1f5fe83b1b2b1 Mon Sep 17 00:00:00 2001 From: Jeff Shen Date: Thu, 15 Dec 2022 19:47:47 -0500 Subject: [PATCH] update np.float and np.int --- fastkde/fastKDE.py | 4 ++-- fastkde/nufft.pyx | 22 +++++++++++----------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/fastkde/fastKDE.py b/fastkde/fastKDE.py index d9fa2cf..f4b243c 100644 --- a/fastkde/fastKDE.py +++ b/fastkde/fastKDE.py @@ -158,9 +158,9 @@ def vprint(msg): dataRank = len(shape(data)) #If the data are a vector, promote the data to a rank-1 array with only 1 column if(dataRank == 1): - data = array(originalData[newaxis,:],dtype=npy.float) + data = array(originalData[newaxis,:],dtype=npy.float_) else: - data = array(originalData,dtype=npy.float) + data = array(originalData,dtype=npy.float_) if(dataRank > 2): raise ValueError("data must be a rank-2 array of shape [numVariables,numDataPoints]") diff --git a/fastkde/nufft.pyx b/fastkde/nufft.pyx index a67d1a0..55eedff 100644 --- a/fastkde/nufft.pyx +++ b/fastkde/nufft.pyx @@ -114,7 +114,7 @@ cpdef np.ndarray[double complex] nuifft( \ #******************************************** vprint("Getting the size of the frequency spaces",beVerbose) cdef int n,t,iNotMissing - cdef np.int_t [:] frequencySizes = np.zeros([numDimensions],dtype=np.int) + cdef np.int_t [:] frequencySizes = np.zeros([numDimensions],dtype=np.int_) for n in range(numDimensions): iNotMissing = 0 @@ -163,8 +163,8 @@ cpdef np.ndarray[double complex] nuifft( \ hyperSlabSize = nspread**numDimensions #get the shape of a hyperslab - #cdef np.ndarray[np.int_t,ndim=1] hyperSlabShape = nspread*np.ones([numDimensions],dtype=np.int) - cdef np.int_t [:] hyperSlabShape = nspread*np.ones([numDimensions],dtype=np.int) + #cdef np.ndarray[np.int_t,ndim=1] hyperSlabShape = nspread*np.ones([numDimensions],dtype=np.int_) + cdef np.int_t [:] hyperSlabShape = nspread*np.ones([numDimensions],dtype=np.int_) vprint("\tconvolution hyperslab shape: {}".format(hyperSlabShape),beVerbose) #Calculate the quantities necessary for estimating x-indices @@ -174,9 +174,9 @@ cpdef np.ndarray[double complex] nuifft( \ deltaxs = np.array([ abscissaGrids[n,1] - abscissaGrids[n,0] for n in range(numDimensions) ]) #Inialize worker terms for the convolution - #cdef np.ndarray[long,ndim=1] mvec = np.zeros([numDimensions],dtype=np.int) - cdef np.int_t [:] mvec = np.zeros([numDimensions],dtype=np.int) - cdef np.int_t [:] m0vec = np.zeros([numDimensions],dtype=np.int) + #cdef np.ndarray[long,ndim=1] mvec = np.zeros([numDimensions],dtype=np.int_) + cdef np.int_t [:] mvec = np.zeros([numDimensions],dtype=np.int_) + cdef np.int_t [:] m0vec = np.zeros([numDimensions],dtype=np.int_) cdef np.float_t [:] mprimevec = np.zeros([numDimensions]) cdef np.float_t mprime = 0.0 cdef double complex gaussTerm = 0.0 @@ -247,7 +247,7 @@ cpdef np.ndarray[double complex] nuifft( \ #Pre-declare and allocate a raveled form of the DFT cdef double complex [:] DFT = np.zeros([freqSpaceSize],dtype=np.complex128) #Pre declare a dimension index vector - cdef np.int_t [:] dimInds = np.zeros([numDimensions],dtype=np.int) + cdef np.int_t [:] dimInds = np.zeros([numDimensions],dtype=np.int_) #Deconvolve the FFT (divide by the FFT of the gaussian) to obtain the DFT estimate vprint("Deconvolving the Fourier transformed data",beVerbose) @@ -354,7 +354,7 @@ cpdef np.ndarray[double complex] idft( \ #******************************************** vprint("Getting the size of the frequency spaces",beVerbose) cdef int n,t,iNotMissing - cdef np.int_t [:] frequencySizes = np.zeros([numDimensions],dtype=np.int) + cdef np.int_t [:] frequencySizes = np.zeros([numDimensions],dtype=np.int_) for n in range(numDimensions): iNotMissing = 0 @@ -375,7 +375,7 @@ cpdef np.ndarray[double complex] idft( \ cdef int i,k #Pre declare a dimension index vector - cdef np.int_t [:] dimInds = np.zeros([numDimensions],dtype=np.int) + cdef np.int_t [:] dimInds = np.zeros([numDimensions],dtype=np.int_) cdef double complex myDFT cdef double expArg @@ -577,7 +577,7 @@ cpdef np.ndarray[double complex] dft_points( \ #******************************************** vprint("Getting the size of the frequency spaces",beVerbose) cdef int t,iNotMissing - cdef np.int_t [:] frequencySizes = np.zeros([numDimensions],dtype=np.int) + cdef np.int_t [:] frequencySizes = np.zeros([numDimensions],dtype=np.int_) for n in range(numDimensions): iNotMissing = 0 @@ -596,7 +596,7 @@ cpdef np.ndarray[double complex] dft_points( \ cdef double complex [:] DFT = np.zeros([freqSpaceSize],dtype=np.complex128) #Pre declare a dimension index vector - cdef np.int_t [:] dimInds = np.zeros([numDimensions],dtype=np.int) + cdef np.int_t [:] dimInds = np.zeros([numDimensions],dtype=np.int_) vprint("Calculating the DFT",beVerbose) with nogil: