Skip to content

Commit

Permalink
Force orders to int64
Browse files Browse the repository at this point in the history
  • Loading branch information
djhoese committed Jun 26, 2024
1 parent 9556272 commit 91e38ca
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion geotiepoints/multilinear.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class MultilinearInterpolator:
def __init__(self, smin, smax, orders, values=None, dtype=np.float64):
self.smin = np.asarray(smin, dtype=dtype)
self.smax = np.asarray(smax, dtype=dtype)
self.orders = np.asarray(orders, dtype=np.int_)
self.orders = np.asarray(orders, dtype=np.int64)
self.d = len(orders)
self.dtype = dtype
if values is not None:
Expand Down
12 changes: 6 additions & 6 deletions geotiepoints/multilinear_cython.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import numpy as np
np.import_array()


def multilinear_interpolation(floating[:] smin, floating[:] smax, int[:] orders, floating[:,::1] values, floating[:,::1] s):
def multilinear_interpolation(floating[:] smin, floating[:] smax, np.int64_t[:] orders, floating[:,::1] values, floating[:,::1] s):

cdef Py_ssize_t d = s.shape[0]
cdef Py_ssize_t n_s = s.shape[1]
Expand Down Expand Up @@ -46,7 +46,7 @@ def multilinear_interpolation(floating[:] smin, floating[:] smax, int[:] orders,


cdef void multilinear_interpolation_1d(floating[:] smin, floating[:] smax,
int[:] orders, floating[:] V,
np.int64_t[:] orders, floating[:] V,
int n_s, floating[:,::1] s, floating[:] output) noexcept nogil:

cdef int i
Expand Down Expand Up @@ -79,7 +79,7 @@ cdef void multilinear_interpolation_1d(floating[:] smin, floating[:] smax,


cdef void multilinear_interpolation_2d(floating[:] smin, floating[:] smax,
int[:] orders, floating[:] V,
np.int64_t[:] orders, floating[:] V,
int n_s, floating[:,::1] s, floating[:] output) noexcept nogil:

cdef int i
Expand Down Expand Up @@ -124,7 +124,7 @@ cdef void multilinear_interpolation_2d(floating[:] smin, floating[:] smax,


cdef void multilinear_interpolation_3d(floating[:] smin, floating[:] smax,
int[:] orders, floating[:] V,
np.int64_t[:] orders, floating[:] V,
int n_s, floating[:,::1] s, floating[:] output) noexcept nogil:
cdef int i
cdef floating lam_0, s_0, sn_0, snt_0
Expand Down Expand Up @@ -184,7 +184,7 @@ cdef void multilinear_interpolation_3d(floating[:] smin, floating[:] smax,


cdef void multilinear_interpolation_4d(floating[:] smin, floating[:] smax,
int[:] orders, floating[:] V,
np.int64_t[:] orders, floating[:] V,
int n_s, floating[:,::1] s, floating[:] output) noexcept nogil:

cdef int i
Expand Down Expand Up @@ -269,7 +269,7 @@ cdef void multilinear_interpolation_4d(floating[:] smin, floating[:] smax,


cdef void multilinear_interpolation_5d(floating[:] smin, floating[:] smax,
int[:] orders, floating[:] V,
np.int64_t[:] orders, floating[:] V,
int n_s, floating[:,::1] s, floating[:] output) noexcept nogil:
cdef int i
cdef floating lam_0, s_0, sn_0, snt_0
Expand Down

0 comments on commit 91e38ca

Please sign in to comment.