diff --git a/src/fastkde/floodFillSearch.c b/src/fastkde/floodFillSearch.c index af66ecf..2ab2d71 100644 --- a/src/fastkde/floodFillSearch.c +++ b/src/fastkde/floodFillSearch.c @@ -1,4 +1,26 @@ -/* Generated by Cython 3.0.3 */ +/* Generated by Cython 3.0.11 */ + +/* BEGIN: Cython Metadata +{ + "distutils": { + "depends": [ + "/Users/adam/phd/env_312/lib/python3.12/site-packages/numpy/_core/include/numpy/arrayobject.h", + "/Users/adam/phd/env_312/lib/python3.12/site-packages/numpy/_core/include/numpy/arrayscalars.h", + "/Users/adam/phd/env_312/lib/python3.12/site-packages/numpy/_core/include/numpy/ndarrayobject.h", + "/Users/adam/phd/env_312/lib/python3.12/site-packages/numpy/_core/include/numpy/ndarraytypes.h", + "/Users/adam/phd/env_312/lib/python3.12/site-packages/numpy/_core/include/numpy/ufuncobject.h" + ], + "include_dirs": [ + "/Users/adam/phd/env_312/lib/python3.12/site-packages/numpy/_core/include" + ], + "name": "fastkde.floodFillSearch", + "sources": [ + "src/fastkde/floodFillSearch.pyx" + ] + }, + "module_name": "fastkde.floodFillSearch" +} +END: Cython Metadata */ #ifndef PY_SSIZE_T_CLEAN #define PY_SSIZE_T_CLEAN @@ -19,15 +41,15 @@ #elif PY_VERSION_HEX < 0x02070000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) #error Cython requires Python 2.7+ or Python 3.3+. #else -#if CYTHON_LIMITED_API +#if defined(CYTHON_LIMITED_API) && CYTHON_LIMITED_API #define __PYX_EXTRA_ABI_MODULE_NAME "limited" #else #define __PYX_EXTRA_ABI_MODULE_NAME "" #endif -#define CYTHON_ABI "3_0_3" __PYX_EXTRA_ABI_MODULE_NAME +#define CYTHON_ABI "3_0_11" __PYX_EXTRA_ABI_MODULE_NAME #define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI #define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "." -#define CYTHON_HEX_VERSION 0x030003F0 +#define CYTHON_HEX_VERSION 0x03000BF0 #define CYTHON_FUTURE_DIVISION 0 #include #ifndef offsetof @@ -119,6 +141,8 @@ #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif + #undef CYTHON_USE_FREELISTS + #define CYTHON_USE_FREELISTS 0 #elif defined(PYPY_VERSION) #define CYTHON_COMPILING_IN_PYPY 1 #define CYTHON_COMPILING_IN_CPYTHON 0 @@ -180,6 +204,8 @@ #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif + #undef CYTHON_USE_FREELISTS + #define CYTHON_USE_FREELISTS 0 #elif defined(CYTHON_LIMITED_API) #ifdef Py_LIMITED_API #undef __PYX_LIMITED_VERSION_HEX @@ -241,7 +267,9 @@ #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif -#elif defined(PY_NOGIL) + #undef CYTHON_USE_FREELISTS + #define CYTHON_USE_FREELISTS 0 +#elif defined(Py_GIL_DISABLED) || defined(Py_NOGIL) #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 @@ -250,11 +278,17 @@ #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif + #ifndef CYTHON_USE_TYPE_SPECS + #define CYTHON_USE_TYPE_SPECS 0 + #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #ifndef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 1 #endif + #ifndef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #ifndef CYTHON_USE_UNICODE_INTERNALS @@ -262,8 +296,6 @@ #endif #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 - #undef CYTHON_USE_PYLONG_INTERNALS - #define CYTHON_USE_PYLONG_INTERNALS 0 #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif @@ -275,11 +307,22 @@ #endif #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_GIL + #define CYTHON_FAST_GIL 0 + #ifndef CYTHON_METH_FASTCALL + #define CYTHON_METH_FASTCALL 1 + #endif #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 + #ifndef CYTHON_PEP487_INIT_SUBCLASS + #define CYTHON_PEP487_INIT_SUBCLASS 1 + #endif #ifndef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif + #ifndef CYTHON_USE_MODULE_STATE + #define CYTHON_USE_MODULE_STATE 0 + #endif #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 1 #endif @@ -287,6 +330,12 @@ #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 + #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC + #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 + #endif + #ifndef CYTHON_USE_FREELISTS + #define CYTHON_USE_FREELISTS 0 + #endif #else #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 1 @@ -377,6 +426,9 @@ #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 #endif + #ifndef CYTHON_USE_FREELISTS + #define CYTHON_USE_FREELISTS 1 + #endif #endif #if !defined(CYTHON_FAST_PYCCALL) #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) @@ -569,18 +621,19 @@ PyObject *exception_table = NULL; PyObject *types_module=NULL, *code_type=NULL, *result=NULL; #if __PYX_LIMITED_VERSION_HEX < 0x030B0000 - PyObject *version_info; // borrowed - #endif + PyObject *version_info; PyObject *py_minor_version = NULL; + #endif long minor_version = 0; PyObject *type, *value, *traceback; PyErr_Fetch(&type, &value, &traceback); #if __PYX_LIMITED_VERSION_HEX >= 0x030B0000 - minor_version = 11; // we don't yet need to distinguish between versions > 11 + minor_version = 11; #else if (!(version_info = PySys_GetObject("version_info"))) goto end; if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end; minor_version = PyLong_AsLong(py_minor_version); + Py_DECREF(py_minor_version); if (minor_version == -1 && PyErr_Occurred()) goto end; #endif if (!(types_module = PyImport_ImportModule("types"))) goto end; @@ -601,7 +654,6 @@ Py_XDECREF(code_type); Py_XDECREF(exception_table); Py_XDECREF(types_module); - Py_XDECREF(py_minor_version); if (type) { PyErr_Restore(type, value, traceback); } @@ -634,7 +686,7 @@ PyObject *fv, PyObject *cell, PyObject* fn, PyObject *name, int fline, PyObject *lnos) { PyCodeObject *result; - PyObject *empty_bytes = PyBytes_FromStringAndSize("", 0); // we don't have access to __pyx_empty_bytes here + PyObject *empty_bytes = PyBytes_FromStringAndSize("", 0); if (!empty_bytes) return NULL; result = #if PY_VERSION_HEX >= 0x030C0000 @@ -720,8 +772,13 @@ typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames); #else - #define __Pyx_PyCFunctionFast _PyCFunctionFast - #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords + #if PY_VERSION_HEX >= 0x030d00A4 + # define __Pyx_PyCFunctionFast PyCFunctionFast + # define __Pyx_PyCFunctionFastWithKeywords PyCFunctionFastWithKeywords + #else + # define __Pyx_PyCFunctionFast _PyCFunctionFast + # define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords + #endif #endif #if CYTHON_METH_FASTCALL #define __Pyx_METH_FASTCALL METH_FASTCALL @@ -796,6 +853,8 @@ static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void *cfunc) { #define __Pyx_PyThreadState_Current PyThreadState_Get() #elif !CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_Current PyThreadState_GET() +#elif PY_VERSION_HEX >= 0x030d00A1 + #define __Pyx_PyThreadState_Current PyThreadState_GetUnchecked() #elif PY_VERSION_HEX >= 0x03060000 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() #elif PY_VERSION_HEX >= 0x03000000 @@ -871,7 +930,7 @@ static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { } #endif #endif -#if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized) +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 || defined(_PyDict_NewPresized) #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) #else #define __Pyx_PyDict_NewPresized(n) PyDict_New() @@ -883,7 +942,7 @@ static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) #endif -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030600B4 && CYTHON_USE_UNICODE_INTERNALS +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030600B4 && PY_VERSION_HEX < 0x030d0000 && CYTHON_USE_UNICODE_INTERNALS #define __Pyx_PyDict_GetItemStrWithError(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) { PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name); @@ -927,7 +986,7 @@ static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, #endif #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX >= 0x03080000 #define __Pyx_PyHeapTypeObject_GC_Del(obj) {\ - PyTypeObject *type = Py_TYPE(obj);\ + PyTypeObject *type = Py_TYPE((PyObject*)obj);\ assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\ PyObject_GC_Del(obj);\ Py_DECREF(type);\ @@ -1071,6 +1130,15 @@ static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o) #endif +#if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 + #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name) +#else + static CYTHON_INLINE PyObject *__Pyx_PyImport_AddModuleRef(const char *name) { + PyObject *module = PyImport_AddModule(name); + Py_XINCREF(module); + return module; + } +#endif #if PY_MAJOR_VERSION >= 3 #define PyIntObject PyLongObject #define PyInt_Type PyLong_Type @@ -1149,7 +1217,7 @@ static CYTHON_INLINE float __PYX_NAN() { #endif #define __PYX_MARK_ERR_POS(f_index, lineno) \ - { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; } + { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; } #define __PYX_ERR(f_index, lineno, Ln_error) \ { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; } @@ -1264,24 +1332,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) -#if CYTHON_COMPILING_IN_LIMITED_API -static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const wchar_t *u) -{ - const wchar_t *u_end = u; - while (*u_end++) ; - return (size_t)(u_end - u - 1); -} -#else -static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) -{ - const Py_UNICODE *u_end = u; - while (*u_end++) ; - return (size_t)(u_end - u - 1); -} -#endif #define __Pyx_PyUnicode_FromOrdinal(o) PyUnicode_FromOrdinal((int)o) -#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) -#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) @@ -1331,7 +1382,7 @@ static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*); #endif typedef Py_ssize_t __Pyx_compact_pylong; typedef size_t __Pyx_compact_upylong; - #else // Py < 3.12 + #else #define __Pyx_PyLong_IsNeg(x) (Py_SIZE(x) < 0) #define __Pyx_PyLong_IsNonNeg(x) (Py_SIZE(x) >= 0) #define __Pyx_PyLong_IsZero(x) (Py_SIZE(x) == 0) @@ -1451,7 +1502,7 @@ static const char *__pyx_filename; #if !defined(CYTHON_CCOMPLEX) #if defined(__cplusplus) #define CYTHON_CCOMPLEX 1 - #elif (defined(_Complex_I) && !defined(_MSC_VER)) || ((defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) && !defined(__STDC_NO_COMPLEX__)) + #elif (defined(_Complex_I) && !defined(_MSC_VER)) || ((defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) && !defined(__STDC_NO_COMPLEX__) && !defined(_MSC_VER)) #define CYTHON_CCOMPLEX 1 #else #define CYTHON_CCOMPLEX 0 @@ -1472,7 +1523,7 @@ static const char *__pyx_filename; /* #### Code section: filename_table ### */ static const char *__pyx_f[] = { - "floodFillSearch.pyx", + "src/fastkde/floodFillSearch.pyx", "", "__init__.cython-30.pxd", "type.pxd", @@ -1621,7 +1672,7 @@ typedef struct { /* #### Code section: numeric_typedefs ### */ -/* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":730 +/* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":769 * # in Cython to enable them only on the right systems. * * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<< @@ -1630,7 +1681,7 @@ typedef struct { */ typedef npy_int8 __pyx_t_5numpy_int8_t; -/* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":731 +/* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":770 * * ctypedef npy_int8 int8_t * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<< @@ -1639,7 +1690,7 @@ typedef npy_int8 __pyx_t_5numpy_int8_t; */ typedef npy_int16 __pyx_t_5numpy_int16_t; -/* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":732 +/* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":771 * ctypedef npy_int8 int8_t * ctypedef npy_int16 int16_t * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<< @@ -1648,7 +1699,7 @@ typedef npy_int16 __pyx_t_5numpy_int16_t; */ typedef npy_int32 __pyx_t_5numpy_int32_t; -/* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":733 +/* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":772 * ctypedef npy_int16 int16_t * ctypedef npy_int32 int32_t * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<< @@ -1657,7 +1708,7 @@ typedef npy_int32 __pyx_t_5numpy_int32_t; */ typedef npy_int64 __pyx_t_5numpy_int64_t; -/* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":737 +/* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":776 * #ctypedef npy_int128 int128_t * * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<< @@ -1666,7 +1717,7 @@ typedef npy_int64 __pyx_t_5numpy_int64_t; */ typedef npy_uint8 __pyx_t_5numpy_uint8_t; -/* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":738 +/* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":777 * * ctypedef npy_uint8 uint8_t * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<< @@ -1675,7 +1726,7 @@ typedef npy_uint8 __pyx_t_5numpy_uint8_t; */ typedef npy_uint16 __pyx_t_5numpy_uint16_t; -/* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":739 +/* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":778 * ctypedef npy_uint8 uint8_t * ctypedef npy_uint16 uint16_t * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<< @@ -1684,7 +1735,7 @@ typedef npy_uint16 __pyx_t_5numpy_uint16_t; */ typedef npy_uint32 __pyx_t_5numpy_uint32_t; -/* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":740 +/* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":779 * ctypedef npy_uint16 uint16_t * ctypedef npy_uint32 uint32_t * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<< @@ -1693,7 +1744,7 @@ typedef npy_uint32 __pyx_t_5numpy_uint32_t; */ typedef npy_uint64 __pyx_t_5numpy_uint64_t; -/* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":744 +/* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":783 * #ctypedef npy_uint128 uint128_t * * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<< @@ -1702,7 +1753,7 @@ typedef npy_uint64 __pyx_t_5numpy_uint64_t; */ typedef npy_float32 __pyx_t_5numpy_float32_t; -/* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":745 +/* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":784 * * ctypedef npy_float32 float32_t * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<< @@ -1711,43 +1762,25 @@ typedef npy_float32 __pyx_t_5numpy_float32_t; */ typedef npy_float64 __pyx_t_5numpy_float64_t; -/* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":754 - * # The int types are mapped a bit surprising -- - * # numpy.int corresponds to 'l' and numpy.long to 'q' - * ctypedef npy_long int_t # <<<<<<<<<<<<<< - * ctypedef npy_longlong longlong_t +/* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":791 + * ctypedef double complex complex128_t * - */ -typedef npy_long __pyx_t_5numpy_int_t; - -/* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":755 - * # numpy.int corresponds to 'l' and numpy.long to 'q' - * ctypedef npy_long int_t * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<< - * - * ctypedef npy_ulong uint_t - */ -typedef npy_longlong __pyx_t_5numpy_longlong_t; - -/* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":757 - * ctypedef npy_longlong longlong_t - * - * ctypedef npy_ulong uint_t # <<<<<<<<<<<<<< * ctypedef npy_ulonglong ulonglong_t * */ -typedef npy_ulong __pyx_t_5numpy_uint_t; +typedef npy_longlong __pyx_t_5numpy_longlong_t; -/* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":758 +/* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":792 * - * ctypedef npy_ulong uint_t + * ctypedef npy_longlong longlong_t * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<< * * ctypedef npy_intp intp_t */ typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t; -/* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":760 +/* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":794 * ctypedef npy_ulonglong ulonglong_t * * ctypedef npy_intp intp_t # <<<<<<<<<<<<<< @@ -1756,7 +1789,7 @@ typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t; */ typedef npy_intp __pyx_t_5numpy_intp_t; -/* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":761 +/* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":795 * * ctypedef npy_intp intp_t * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<< @@ -1765,7 +1798,7 @@ typedef npy_intp __pyx_t_5numpy_intp_t; */ typedef npy_uintp __pyx_t_5numpy_uintp_t; -/* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":763 +/* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":797 * ctypedef npy_uintp uintp_t * * ctypedef npy_double float_t # <<<<<<<<<<<<<< @@ -1774,7 +1807,7 @@ typedef npy_uintp __pyx_t_5numpy_uintp_t; */ typedef npy_double __pyx_t_5numpy_float_t; -/* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":764 +/* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":798 * * ctypedef npy_double float_t * ctypedef npy_double double_t # <<<<<<<<<<<<<< @@ -1783,12 +1816,12 @@ typedef npy_double __pyx_t_5numpy_float_t; */ typedef npy_double __pyx_t_5numpy_double_t; -/* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":765 +/* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":799 * ctypedef npy_double float_t * ctypedef npy_double double_t * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<< * - * ctypedef npy_cfloat cfloat_t + * ctypedef float complex cfloat_t */ typedef npy_longdouble __pyx_t_5numpy_longdouble_t; /* #### Code section: complex_type_declarations ### */ @@ -1816,6 +1849,18 @@ static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(floa #endif static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double); +/* Declarations.proto */ +#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus) + #ifdef __cplusplus + typedef ::std::complex< long double > __pyx_t_long_double_complex; + #else + typedef long double _Complex __pyx_t_long_double_complex; + #endif +#else + typedef struct { long double real, imag; } __pyx_t_long_double_complex; +#endif +static CYTHON_INLINE __pyx_t_long_double_complex __pyx_t_long_double_complex_from_parts(long double, long double); + /* #### Code section: type_declarations ### */ /*--- Type declarations ---*/ @@ -1825,41 +1870,23 @@ struct __pyx_MemviewEnum_obj; struct __pyx_memoryview_obj; struct __pyx_memoryviewslice_obj; -/* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":767 - * ctypedef npy_longdouble longdouble_t - * - * ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<< - * ctypedef npy_cdouble cdouble_t - * ctypedef npy_clongdouble clongdouble_t - */ -typedef npy_cfloat __pyx_t_5numpy_cfloat_t; - -/* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":768 +/* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1095 * - * ctypedef npy_cfloat cfloat_t - * ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<< - * ctypedef npy_clongdouble clongdouble_t - * - */ -typedef npy_cdouble __pyx_t_5numpy_cdouble_t; - -/* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":769 - * ctypedef npy_cfloat cfloat_t - * ctypedef npy_cdouble cdouble_t - * ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<< + * # Iterator API added in v1.6 + * ctypedef int (*NpyIter_IterNextFunc)(NpyIter* it) noexcept nogil # <<<<<<<<<<<<<< + * ctypedef void (*NpyIter_GetMultiIndexFunc)(NpyIter* it, npy_intp* outcoords) noexcept nogil * - * ctypedef npy_cdouble complex_t */ -typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t; +typedef int (*__pyx_t_5numpy_NpyIter_IterNextFunc)(NpyIter *); -/* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":771 - * ctypedef npy_clongdouble clongdouble_t - * - * ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<< +/* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1096 + * # Iterator API added in v1.6 + * ctypedef int (*NpyIter_IterNextFunc)(NpyIter* it) noexcept nogil + * ctypedef void (*NpyIter_GetMultiIndexFunc)(NpyIter* it, npy_intp* outcoords) noexcept nogil # <<<<<<<<<<<<<< * - * cdef inline object PyArray_MultiIterNew1(a): + * cdef extern from "numpy/arrayobject.h": */ -typedef npy_cdouble __pyx_t_5numpy_complex_t; +typedef void (*__pyx_t_5numpy_NpyIter_GetMultiIndexFunc)(NpyIter *, npy_intp *); struct __pyx_opt_args_7fastkde_15floodFillSearch_flood_fill_search; /* "fastkde/floodFillSearch.pyx":163 @@ -2190,8 +2217,8 @@ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int #define __Pyx_Arg_NewRef_VARARGS(arg) __Pyx_NewRef(arg) #define __Pyx_Arg_XDECREF_VARARGS(arg) Py_XDECREF(arg) #else - #define __Pyx_Arg_NewRef_VARARGS(arg) arg // no-op - #define __Pyx_Arg_XDECREF_VARARGS(arg) // no-op - arg is borrowed + #define __Pyx_Arg_NewRef_VARARGS(arg) arg + #define __Pyx_Arg_XDECREF_VARARGS(arg) #endif #define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds) #define __Pyx_KwValues_VARARGS(args, nargs) NULL @@ -2202,9 +2229,14 @@ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int #define __Pyx_NumKwargs_FASTCALL(kwds) PyTuple_GET_SIZE(kwds) #define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs)) static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s); +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 + CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues); + #else #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw) - #define __Pyx_Arg_NewRef_FASTCALL(arg) arg // no-op, __Pyx_Arg_FASTCALL is direct and this needs - #define __Pyx_Arg_XDECREF_FASTCALL(arg) // no-op - arg was returned from array + #endif + #define __Pyx_Arg_NewRef_FASTCALL(arg) arg /* no-op, __Pyx_Arg_FASTCALL is direct and this needs + to have the same reference counting */ + #define __Pyx_Arg_XDECREF_FASTCALL(arg) #else #define __Pyx_Arg_FASTCALL __Pyx_Arg_VARARGS #define __Pyx_NumKwargs_FASTCALL __Pyx_NumKwargs_VARARGS @@ -2552,7 +2584,11 @@ static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) { Py_ssize_t len = Py_SIZE(list); if (likely(L->allocated > len)) { Py_INCREF(x); + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 + L->ob_item[len] = x; + #else PyList_SET_ITEM(list, len, x); + #endif __Pyx_SET_SIZE(list, len + 1); return 0; } @@ -2604,7 +2640,11 @@ static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) { Py_ssize_t len = Py_SIZE(list); if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) { Py_INCREF(x); + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 + L->ob_item[len] = x; + #else PyList_SET_ITEM(list, len, x); + #endif __Pyx_SET_SIZE(list, len + 1); return 0; } @@ -2729,22 +2769,22 @@ static int __Pyx_setup_reduce(PyObject* type_obj); #endif /* TypeImport.proto */ -#ifndef __PYX_HAVE_RT_ImportType_proto_3_0_3 -#define __PYX_HAVE_RT_ImportType_proto_3_0_3 +#ifndef __PYX_HAVE_RT_ImportType_proto_3_0_11 +#define __PYX_HAVE_RT_ImportType_proto_3_0_11 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L #include #endif #if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) || __cplusplus >= 201103L -#define __PYX_GET_STRUCT_ALIGNMENT_3_0_3(s) alignof(s) +#define __PYX_GET_STRUCT_ALIGNMENT_3_0_11(s) alignof(s) #else -#define __PYX_GET_STRUCT_ALIGNMENT_3_0_3(s) sizeof(void*) +#define __PYX_GET_STRUCT_ALIGNMENT_3_0_11(s) sizeof(void*) #endif -enum __Pyx_ImportType_CheckSize_3_0_3 { - __Pyx_ImportType_CheckSize_Error_3_0_3 = 0, - __Pyx_ImportType_CheckSize_Warn_3_0_3 = 1, - __Pyx_ImportType_CheckSize_Ignore_3_0_3 = 2 +enum __Pyx_ImportType_CheckSize_3_0_11 { + __Pyx_ImportType_CheckSize_Error_3_0_11 = 0, + __Pyx_ImportType_CheckSize_Warn_3_0_11 = 1, + __Pyx_ImportType_CheckSize_Ignore_3_0_11 = 2 }; -static PyTypeObject *__Pyx_ImportType_3_0_3(PyObject* module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_3 check_size); +static PyTypeObject *__Pyx_ImportType_3_0_11(PyObject* module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_11 check_size); #endif /* ImportDottedModuleRelFirst.proto */ @@ -2840,7 +2880,7 @@ typedef struct { #endif void *defaults; int defaults_pyobjects; - size_t defaults_size; // used by FusedFunction for copying defaults + size_t defaults_size; int flags; PyObject *defaults_tuple; PyObject *defaults_kwdict; @@ -2970,9 +3010,6 @@ static int __Pyx_ValidateAndInit_memviewslice( /* ObjectToMemviewSlice.proto */ static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float_t(PyObject *, int writable_flag); -/* ObjectToMemviewSlice.proto */ -static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int_t(PyObject *, int writable_flag); - /* ObjectToMemviewSlice.proto */ static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(PyObject *, int writable_flag); @@ -3074,6 +3111,44 @@ static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn_ #endif #endif +/* Arithmetic.proto */ +#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus) + #define __Pyx_c_eq_long__double(a, b) ((a)==(b)) + #define __Pyx_c_sum_long__double(a, b) ((a)+(b)) + #define __Pyx_c_diff_long__double(a, b) ((a)-(b)) + #define __Pyx_c_prod_long__double(a, b) ((a)*(b)) + #define __Pyx_c_quot_long__double(a, b) ((a)/(b)) + #define __Pyx_c_neg_long__double(a) (-(a)) + #ifdef __cplusplus + #define __Pyx_c_is_zero_long__double(z) ((z)==(long double)0) + #define __Pyx_c_conj_long__double(z) (::std::conj(z)) + #if 1 + #define __Pyx_c_abs_long__double(z) (::std::abs(z)) + #define __Pyx_c_pow_long__double(a, b) (::std::pow(a, b)) + #endif + #else + #define __Pyx_c_is_zero_long__double(z) ((z)==0) + #define __Pyx_c_conj_long__double(z) (conjl(z)) + #if 1 + #define __Pyx_c_abs_long__double(z) (cabsl(z)) + #define __Pyx_c_pow_long__double(a, b) (cpowl(a, b)) + #endif + #endif +#else + static CYTHON_INLINE int __Pyx_c_eq_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex); + static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_sum_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex); + static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_diff_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex); + static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_prod_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex); + static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_quot_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex); + static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_neg_long__double(__pyx_t_long_double_complex); + static CYTHON_INLINE int __Pyx_c_is_zero_long__double(__pyx_t_long_double_complex); + static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_conj_long__double(__pyx_t_long_double_complex); + #if 1 + static CYTHON_INLINE long double __Pyx_c_abs_long__double(__pyx_t_long_double_complex); + static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_pow_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex); + #endif +#endif + /* MemviewSliceCopyTemplate.proto */ static __Pyx_memviewslice __pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs, @@ -3115,9 +3190,6 @@ static CYTHON_INLINE npy_int64 __Pyx_PyInt_As_npy_int64(PyObject *); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); -/* CIntToPy.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_long(npy_long value); - /* CIntFromPy.proto */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); @@ -3220,7 +3292,7 @@ static PyObject *__Pyx_Generator_Next(PyObject *self); static int __pyx_Generator_init(PyObject *module); /* CheckBinaryVersion.proto */ -static unsigned long __Pyx_get_runtime_version(); +static unsigned long __Pyx_get_runtime_version(void); static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer); /* InitStrings.proto */ @@ -3239,6 +3311,18 @@ static PyObject *__pyx_memoryview__get_base(struct __pyx_memoryview_obj *__pyx_v static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/ static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/ static PyObject *__pyx_memoryviewslice__get_base(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto*/ +static CYTHON_INLINE npy_intp __pyx_f_5numpy_5dtype_8itemsize_itemsize(PyArray_Descr *__pyx_v_self); /* proto*/ +static CYTHON_INLINE npy_intp __pyx_f_5numpy_5dtype_9alignment_alignment(PyArray_Descr *__pyx_v_self); /* proto*/ +static CYTHON_INLINE PyObject *__pyx_f_5numpy_5dtype_6fields_fields(PyArray_Descr *__pyx_v_self); /* proto*/ +static CYTHON_INLINE PyObject *__pyx_f_5numpy_5dtype_5names_names(PyArray_Descr *__pyx_v_self); /* proto*/ +static CYTHON_INLINE PyArray_ArrayDescr *__pyx_f_5numpy_5dtype_8subarray_subarray(PyArray_Descr *__pyx_v_self); /* proto*/ +static CYTHON_INLINE npy_uint64 __pyx_f_5numpy_5dtype_5flags_flags(PyArray_Descr *__pyx_v_self); /* proto*/ +static CYTHON_INLINE int __pyx_f_5numpy_9broadcast_7numiter_numiter(PyArrayMultiIterObject *__pyx_v_self); /* proto*/ +static CYTHON_INLINE npy_intp __pyx_f_5numpy_9broadcast_4size_size(PyArrayMultiIterObject *__pyx_v_self); /* proto*/ +static CYTHON_INLINE npy_intp __pyx_f_5numpy_9broadcast_5index_index(PyArrayMultiIterObject *__pyx_v_self); /* proto*/ +static CYTHON_INLINE int __pyx_f_5numpy_9broadcast_2nd_nd(PyArrayMultiIterObject *__pyx_v_self); /* proto*/ +static CYTHON_INLINE npy_intp *__pyx_f_5numpy_9broadcast_10dimensions_dimensions(PyArrayMultiIterObject *__pyx_v_self); /* proto*/ +static CYTHON_INLINE void **__pyx_f_5numpy_9broadcast_5iters_iters(PyArrayMultiIterObject *__pyx_v_self); /* proto*/ static CYTHON_INLINE PyObject *__pyx_f_5numpy_7ndarray_4base_base(PyArrayObject *__pyx_v_self); /* proto*/ static CYTHON_INLINE PyArray_Descr *__pyx_f_5numpy_7ndarray_5descr_descr(PyArrayObject *__pyx_v_self); /* proto*/ static CYTHON_INLINE int __pyx_f_5numpy_7ndarray_4ndim_ndim(PyArrayObject *__pyx_v_self); /* proto*/ @@ -3320,7 +3404,6 @@ static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *, /* #### Code section: typeinfo ### */ static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t = { "int64_t", NULL, sizeof(__pyx_t_5numpy_int64_t), { 0 }, 0, __PYX_IS_UNSIGNED(__pyx_t_5numpy_int64_t) ? 'U' : 'I', __PYX_IS_UNSIGNED(__pyx_t_5numpy_int64_t), 0 }; static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_float_t = { "float_t", NULL, sizeof(__pyx_t_5numpy_float_t), { 0 }, 0, 'R', 0, 0 }; -static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_int_t = { "int_t", NULL, sizeof(__pyx_t_5numpy_int_t), { 0 }, 0, __PYX_IS_UNSIGNED(__pyx_t_5numpy_int_t) ? 'U' : 'I', __PYX_IS_UNSIGNED(__pyx_t_5numpy_int_t), 0 }; /* #### Code section: before_global_var ### */ #define __Pyx_MODULE_NAME "fastkde.floodFillSearch" extern int __pyx_module_is_main_fastkde__floodFillSearch; @@ -3469,7 +3552,6 @@ static const char __pyx_k_pyx_unpickle_Enum[] = "__pyx_unpickle_Enum"; static const char __pyx_k_asyncio_coroutines[] = "asyncio.coroutines"; static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; static const char __pyx_k_strided_and_direct[] = ""; -static const char __pyx_k_floodFillSearch_pyx[] = "floodFillSearch.pyx"; static const char __pyx_k_strided_and_indirect[] = ""; static const char __pyx_k_Invalid_shape_in_axis[] = "Invalid shape in axis "; static const char __pyx_k_contiguous_and_direct[] = ""; @@ -3485,7 +3567,7 @@ static const char __pyx_k_itemsize_0_for_cython_array[] = "itemsize <= 0 for cyt static const char __pyx_k_sort_by_distance_from_center[] = "sort_by_distance_from_center"; static const char __pyx_k_unable_to_allocate_array_data[] = "unable to allocate array data."; static const char __pyx_k_strided_and_direct_or_indirect[] = ""; -static const char __pyx_k_numpy_core_multiarray_failed_to[] = "numpy.core.multiarray failed to import"; +static const char __pyx_k_src_fastkde_floodFillSearch_pyx[] = "src/fastkde/floodFillSearch.pyx"; static const char __pyx_k_All_dimensions_preceding_dimensi[] = "All dimensions preceding dimension %d must be indexed and not sliced"; static const char __pyx_k_Buffer_view_does_not_expose_stri[] = "Buffer view does not expose strides"; static const char __pyx_k_Can_only_create_a_buffer_that_is[] = "Can only create a buffer that is contiguous in memory."; @@ -3501,7 +3583,8 @@ static const char __pyx_k_Unable_to_convert_item_to_object[] = "Unable to conver static const char __pyx_k_got_differing_extents_in_dimensi[] = "got differing extents in dimension "; static const char __pyx_k_input_array_does_not_appear_to_b[] = "input_array does not appear to be array like. Error was: {}"; static const char __pyx_k_no_default___reduce___due_to_non[] = "no default __reduce__ due to non-trivial __cinit__"; -static const char __pyx_k_numpy_core_umath_failed_to_impor[] = "numpy.core.umath failed to import"; +static const char __pyx_k_numpy__core_multiarray_failed_to[] = "numpy._core.multiarray failed to import"; +static const char __pyx_k_numpy__core_umath_failed_to_impo[] = "numpy._core.umath failed to import"; static const char __pyx_k_sort_by_distance_from_center_loc[] = "sort_by_distance_from_center..genexpr"; static const char __pyx_k_unable_to_allocate_shape_and_str[] = "unable to allocate shape and strides."; static const char __pyx_k_wrap_dimensions_must_be_a_list_o[] = "wrap_dimensions must be a list of valid dimensions for input_array. Original error was: {}"; @@ -3708,7 +3791,6 @@ typedef struct { PyObject *__pyx_n_s_error; PyObject *__pyx_n_s_fastkde_floodFillSearch; PyObject *__pyx_n_s_flags; - PyObject *__pyx_kp_s_floodFillSearch_pyx; PyObject *__pyx_n_s_flood_fill_search; PyObject *__pyx_n_s_format; PyObject *__pyx_n_s_fortran; @@ -3745,8 +3827,8 @@ typedef struct { PyObject *__pyx_kp_s_no_default___reduce___due_to_non; PyObject *__pyx_n_s_np; PyObject *__pyx_n_s_numpy; - PyObject *__pyx_kp_s_numpy_core_multiarray_failed_to; - PyObject *__pyx_kp_s_numpy_core_umath_failed_to_impor; + PyObject *__pyx_kp_s_numpy__core_multiarray_failed_to; + PyObject *__pyx_kp_s_numpy__core_umath_failed_to_impo; PyObject *__pyx_n_s_obj; PyObject *__pyx_n_s_ones; PyObject *__pyx_n_s_pack; @@ -3776,6 +3858,7 @@ typedef struct { PyObject *__pyx_n_s_sort_by_distance_from_center_loc; PyObject *__pyx_n_s_spec; PyObject *__pyx_n_s_sqrt; + PyObject *__pyx_kp_s_src_fastkde_floodFillSearch_pyx; PyObject *__pyx_n_s_start; PyObject *__pyx_n_s_step; PyObject *__pyx_n_s_stop; @@ -3970,7 +4053,6 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_n_s_error); Py_CLEAR(clear_module_state->__pyx_n_s_fastkde_floodFillSearch); Py_CLEAR(clear_module_state->__pyx_n_s_flags); - Py_CLEAR(clear_module_state->__pyx_kp_s_floodFillSearch_pyx); Py_CLEAR(clear_module_state->__pyx_n_s_flood_fill_search); Py_CLEAR(clear_module_state->__pyx_n_s_format); Py_CLEAR(clear_module_state->__pyx_n_s_fortran); @@ -4007,8 +4089,8 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_kp_s_no_default___reduce___due_to_non); Py_CLEAR(clear_module_state->__pyx_n_s_np); Py_CLEAR(clear_module_state->__pyx_n_s_numpy); - Py_CLEAR(clear_module_state->__pyx_kp_s_numpy_core_multiarray_failed_to); - Py_CLEAR(clear_module_state->__pyx_kp_s_numpy_core_umath_failed_to_impor); + Py_CLEAR(clear_module_state->__pyx_kp_s_numpy__core_multiarray_failed_to); + Py_CLEAR(clear_module_state->__pyx_kp_s_numpy__core_umath_failed_to_impo); Py_CLEAR(clear_module_state->__pyx_n_s_obj); Py_CLEAR(clear_module_state->__pyx_n_s_ones); Py_CLEAR(clear_module_state->__pyx_n_s_pack); @@ -4038,6 +4120,7 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_n_s_sort_by_distance_from_center_loc); Py_CLEAR(clear_module_state->__pyx_n_s_spec); Py_CLEAR(clear_module_state->__pyx_n_s_sqrt); + Py_CLEAR(clear_module_state->__pyx_kp_s_src_fastkde_floodFillSearch_pyx); Py_CLEAR(clear_module_state->__pyx_n_s_start); Py_CLEAR(clear_module_state->__pyx_n_s_step); Py_CLEAR(clear_module_state->__pyx_n_s_stop); @@ -4210,7 +4293,6 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_n_s_error); Py_VISIT(traverse_module_state->__pyx_n_s_fastkde_floodFillSearch); Py_VISIT(traverse_module_state->__pyx_n_s_flags); - Py_VISIT(traverse_module_state->__pyx_kp_s_floodFillSearch_pyx); Py_VISIT(traverse_module_state->__pyx_n_s_flood_fill_search); Py_VISIT(traverse_module_state->__pyx_n_s_format); Py_VISIT(traverse_module_state->__pyx_n_s_fortran); @@ -4247,8 +4329,8 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_kp_s_no_default___reduce___due_to_non); Py_VISIT(traverse_module_state->__pyx_n_s_np); Py_VISIT(traverse_module_state->__pyx_n_s_numpy); - Py_VISIT(traverse_module_state->__pyx_kp_s_numpy_core_multiarray_failed_to); - Py_VISIT(traverse_module_state->__pyx_kp_s_numpy_core_umath_failed_to_impor); + Py_VISIT(traverse_module_state->__pyx_kp_s_numpy__core_multiarray_failed_to); + Py_VISIT(traverse_module_state->__pyx_kp_s_numpy__core_umath_failed_to_impo); Py_VISIT(traverse_module_state->__pyx_n_s_obj); Py_VISIT(traverse_module_state->__pyx_n_s_ones); Py_VISIT(traverse_module_state->__pyx_n_s_pack); @@ -4278,6 +4360,7 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_n_s_sort_by_distance_from_center_loc); Py_VISIT(traverse_module_state->__pyx_n_s_spec); Py_VISIT(traverse_module_state->__pyx_n_s_sqrt); + Py_VISIT(traverse_module_state->__pyx_kp_s_src_fastkde_floodFillSearch_pyx); Py_VISIT(traverse_module_state->__pyx_n_s_start); Py_VISIT(traverse_module_state->__pyx_n_s_step); Py_VISIT(traverse_module_state->__pyx_n_s_stop); @@ -4484,7 +4567,6 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_n_s_error __pyx_mstate_global->__pyx_n_s_error #define __pyx_n_s_fastkde_floodFillSearch __pyx_mstate_global->__pyx_n_s_fastkde_floodFillSearch #define __pyx_n_s_flags __pyx_mstate_global->__pyx_n_s_flags -#define __pyx_kp_s_floodFillSearch_pyx __pyx_mstate_global->__pyx_kp_s_floodFillSearch_pyx #define __pyx_n_s_flood_fill_search __pyx_mstate_global->__pyx_n_s_flood_fill_search #define __pyx_n_s_format __pyx_mstate_global->__pyx_n_s_format #define __pyx_n_s_fortran __pyx_mstate_global->__pyx_n_s_fortran @@ -4521,8 +4603,8 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_kp_s_no_default___reduce___due_to_non __pyx_mstate_global->__pyx_kp_s_no_default___reduce___due_to_non #define __pyx_n_s_np __pyx_mstate_global->__pyx_n_s_np #define __pyx_n_s_numpy __pyx_mstate_global->__pyx_n_s_numpy -#define __pyx_kp_s_numpy_core_multiarray_failed_to __pyx_mstate_global->__pyx_kp_s_numpy_core_multiarray_failed_to -#define __pyx_kp_s_numpy_core_umath_failed_to_impor __pyx_mstate_global->__pyx_kp_s_numpy_core_umath_failed_to_impor +#define __pyx_kp_s_numpy__core_multiarray_failed_to __pyx_mstate_global->__pyx_kp_s_numpy__core_multiarray_failed_to +#define __pyx_kp_s_numpy__core_umath_failed_to_impo __pyx_mstate_global->__pyx_kp_s_numpy__core_umath_failed_to_impo #define __pyx_n_s_obj __pyx_mstate_global->__pyx_n_s_obj #define __pyx_n_s_ones __pyx_mstate_global->__pyx_n_s_ones #define __pyx_n_s_pack __pyx_mstate_global->__pyx_n_s_pack @@ -4552,6 +4634,7 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_n_s_sort_by_distance_from_center_loc __pyx_mstate_global->__pyx_n_s_sort_by_distance_from_center_loc #define __pyx_n_s_spec __pyx_mstate_global->__pyx_n_s_spec #define __pyx_n_s_sqrt __pyx_mstate_global->__pyx_n_s_sqrt +#define __pyx_kp_s_src_fastkde_floodFillSearch_pyx __pyx_mstate_global->__pyx_kp_s_src_fastkde_floodFillSearch_pyx #define __pyx_n_s_start __pyx_mstate_global->__pyx_n_s_start #define __pyx_n_s_step __pyx_mstate_global->__pyx_n_s_step #define __pyx_n_s_stop __pyx_mstate_global->__pyx_n_s_stop @@ -4792,10 +4875,11 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; - int __pyx_t_7; + unsigned int __pyx_t_7; char *__pyx_t_8; - Py_ssize_t __pyx_t_9; - Py_UCS4 __pyx_t_10; + int __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_UCS4 __pyx_t_11; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; @@ -5021,7 +5105,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ * if dim <= 0: * raise ValueError, f"Invalid shape in axis {idx}: {dim}." */ - __pyx_t_7 = 0; + __pyx_t_9 = 0; __pyx_t_4 = __pyx_v_shape; __Pyx_INCREF(__pyx_t_4); __pyx_t_1 = 0; for (;;) { @@ -5038,11 +5122,11 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif - __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 159, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 159, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_v_dim = __pyx_t_9; - __pyx_v_idx = __pyx_t_7; - __pyx_t_7 = (__pyx_t_7 + 1); + __pyx_v_dim = __pyx_t_10; + __pyx_v_idx = __pyx_t_9; + __pyx_t_9 = (__pyx_t_9 + 1); /* "View.MemoryView":160 * @@ -5063,33 +5147,33 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ */ __pyx_t_5 = PyTuple_New(5); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 161, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_9 = 0; - __pyx_t_10 = 127; + __pyx_t_10 = 0; + __pyx_t_11 = 127; __Pyx_INCREF(__pyx_kp_u_Invalid_shape_in_axis); - __pyx_t_9 += 22; + __pyx_t_10 += 22; __Pyx_GIVEREF(__pyx_kp_u_Invalid_shape_in_axis); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_kp_u_Invalid_shape_in_axis); __pyx_t_6 = __Pyx_PyUnicode_From_int(__pyx_v_idx, 0, ' ', 'd'); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 161, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_9 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6); + __pyx_t_10 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_6); __pyx_t_6 = 0; __Pyx_INCREF(__pyx_kp_u_); - __pyx_t_9 += 2; + __pyx_t_10 += 2; __Pyx_GIVEREF(__pyx_kp_u_); PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_kp_u_); __pyx_t_6 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_v_dim, 0, ' ', 'd'); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 161, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_9 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6); + __pyx_t_10 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_6); __pyx_t_6 = 0; __Pyx_INCREF(__pyx_kp_u__2); - __pyx_t_9 += 1; + __pyx_t_10 += 1; __Pyx_GIVEREF(__pyx_kp_u__2); PyTuple_SET_ITEM(__pyx_t_5, 4, __pyx_kp_u__2); - __pyx_t_6 = __Pyx_PyUnicode_Join(__pyx_t_5, 5, __pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 161, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyUnicode_Join(__pyx_t_5, 5, __pyx_t_10, __pyx_t_11); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 161, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_builtin_ValueError, __pyx_t_6, 0, 0); @@ -5273,7 +5357,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ * * @cname('getbuffer') */ - __pyx_t_7 = __pyx_array_allocate_buffer(__pyx_v_self); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(1, 180, __pyx_L1_error) + __pyx_t_9 = __pyx_array_allocate_buffer(__pyx_v_self); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 180, __pyx_L1_error) /* "View.MemoryView":179 * self.dtype_is_object = format == b'O' @@ -8428,7 +8512,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setit * * if have_slices: # <<<<<<<<<<<<<< * obj = self.is_slice(value) - * if obj: + * if obj is not None: */ __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(1, 426, __pyx_L1_error) if (__pyx_t_4) { @@ -8437,7 +8521,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setit * * if have_slices: * obj = self.is_slice(value) # <<<<<<<<<<<<<< - * if obj: + * if obj is not None: * self.setitem_slice_assignment(self[index], obj) */ __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->is_slice(__pyx_v_self, __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 427, __pyx_L1_error) @@ -8448,16 +8532,16 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setit /* "View.MemoryView":428 * if have_slices: * obj = self.is_slice(value) - * if obj: # <<<<<<<<<<<<<< + * if obj is not None: # <<<<<<<<<<<<<< * self.setitem_slice_assignment(self[index], obj) * else: */ - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_obj); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(1, 428, __pyx_L1_error) + __pyx_t_4 = (__pyx_v_obj != Py_None); if (__pyx_t_4) { /* "View.MemoryView":429 * obj = self.is_slice(value) - * if obj: + * if obj is not None: * self.setitem_slice_assignment(self[index], obj) # <<<<<<<<<<<<<< * else: * self.setitem_slice_assign_scalar(self[index], value) @@ -8472,7 +8556,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setit /* "View.MemoryView":428 * if have_slices: * obj = self.is_slice(value) - * if obj: # <<<<<<<<<<<<<< + * if obj is not None: # <<<<<<<<<<<<<< * self.setitem_slice_assignment(self[index], obj) * else: */ @@ -8502,7 +8586,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setit * * if have_slices: # <<<<<<<<<<<<<< * obj = self.is_slice(value) - * if obj: + * if obj is not None: */ goto __pyx_L4; } @@ -9210,9 +9294,10 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; - int __pyx_t_8; + unsigned int __pyx_t_8; Py_ssize_t __pyx_t_9; int __pyx_t_10; + int __pyx_t_11; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; @@ -9367,11 +9452,11 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview __Pyx_ErrFetch(&__pyx_t_1, &__pyx_t_5, &__pyx_t_6); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_error); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 498, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_1, __pyx_t_7); + __pyx_t_11 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_1, __pyx_t_7); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_ErrRestore(__pyx_t_1, __pyx_t_5, __pyx_t_6); __pyx_t_1 = 0; __pyx_t_5 = 0; __pyx_t_6 = 0; - if (__pyx_t_8) { + if (__pyx_t_11) { __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_5, &__pyx_t_1) < 0) __PYX_ERR(1, 498, __pyx_L5_except_error) __Pyx_XGOTREF(__pyx_t_6); @@ -9456,7 +9541,7 @@ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryvie PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; - int __pyx_t_6; + unsigned int __pyx_t_6; Py_ssize_t __pyx_t_7; PyObject *__pyx_t_8 = NULL; char *__pyx_t_9; @@ -17930,7 +18015,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSE int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; - int __pyx_t_5; + unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; @@ -18112,7 +18197,7 @@ static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *__ PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; - int __pyx_t_8; + unsigned int __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; @@ -18232,33 +18317,33 @@ static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *__ return __pyx_r; } -/* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":245 +/* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":286 * * @property - * cdef inline PyObject* base(self) nogil: # <<<<<<<<<<<<<< - * """Returns a borrowed reference to the object owning the data/memory. - * """ + * cdef inline npy_intp itemsize(self) noexcept nogil: # <<<<<<<<<<<<<< + * return PyDataType_ELSIZE(self) + * */ -static CYTHON_INLINE PyObject *__pyx_f_5numpy_7ndarray_4base_base(PyArrayObject *__pyx_v_self) { - PyObject *__pyx_r; +static CYTHON_INLINE npy_intp __pyx_f_5numpy_5dtype_8itemsize_itemsize(PyArray_Descr *__pyx_v_self) { + npy_intp __pyx_r; - /* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":248 - * """Returns a borrowed reference to the object owning the data/memory. - * """ - * return PyArray_BASE(self) # <<<<<<<<<<<<<< + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":287 + * @property + * cdef inline npy_intp itemsize(self) noexcept nogil: + * return PyDataType_ELSIZE(self) # <<<<<<<<<<<<<< * * @property */ - __pyx_r = PyArray_BASE(__pyx_v_self); + __pyx_r = PyDataType_ELSIZE(__pyx_v_self); goto __pyx_L0; - /* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":245 + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":286 * * @property - * cdef inline PyObject* base(self) nogil: # <<<<<<<<<<<<<< - * """Returns a borrowed reference to the object owning the data/memory. - * """ + * cdef inline npy_intp itemsize(self) noexcept nogil: # <<<<<<<<<<<<<< + * return PyDataType_ELSIZE(self) + * */ /* function exit code */ @@ -18266,143 +18351,151 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_7ndarray_4base_base(PyArrayObject return __pyx_r; } -/* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":251 +/* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":290 * * @property - * cdef inline dtype descr(self): # <<<<<<<<<<<<<< - * """Returns an owned reference to the dtype of the array. - * """ + * cdef inline npy_intp alignment(self) noexcept nogil: # <<<<<<<<<<<<<< + * return PyDataType_ALIGNMENT(self) + * */ -static CYTHON_INLINE PyArray_Descr *__pyx_f_5numpy_7ndarray_5descr_descr(PyArrayObject *__pyx_v_self) { - PyArray_Descr *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyArray_Descr *__pyx_t_1; - __Pyx_RefNannySetupContext("descr", 1); +static CYTHON_INLINE npy_intp __pyx_f_5numpy_5dtype_9alignment_alignment(PyArray_Descr *__pyx_v_self) { + npy_intp __pyx_r; - /* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":254 - * """Returns an owned reference to the dtype of the array. - * """ - * return PyArray_DESCR(self) # <<<<<<<<<<<<<< - * + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":291 * @property + * cdef inline npy_intp alignment(self) noexcept nogil: + * return PyDataType_ALIGNMENT(self) # <<<<<<<<<<<<<< + * + * # Use fields/names with care as they may be NULL. You must check */ - __Pyx_XDECREF((PyObject *)__pyx_r); - __pyx_t_1 = PyArray_DESCR(__pyx_v_self); - __Pyx_INCREF((PyObject *)((PyArray_Descr *)__pyx_t_1)); - __pyx_r = ((PyArray_Descr *)__pyx_t_1); + __pyx_r = PyDataType_ALIGNMENT(__pyx_v_self); goto __pyx_L0; - /* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":251 + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":290 * * @property - * cdef inline dtype descr(self): # <<<<<<<<<<<<<< - * """Returns an owned reference to the dtype of the array. - * """ + * cdef inline npy_intp alignment(self) noexcept nogil: # <<<<<<<<<<<<<< + * return PyDataType_ALIGNMENT(self) + * */ /* function exit code */ __pyx_L0:; - __Pyx_XGIVEREF((PyObject *)__pyx_r); - __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":257 - * +/* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":296 + * # for this using PyDataType_HASFIELDS. * @property - * cdef inline int ndim(self) nogil: # <<<<<<<<<<<<<< - * """Returns the number of dimensions in the array. - * """ + * cdef inline object fields(self): # <<<<<<<<<<<<<< + * return PyDataType_FIELDS(self) + * */ -static CYTHON_INLINE int __pyx_f_5numpy_7ndarray_4ndim_ndim(PyArrayObject *__pyx_v_self) { - int __pyx_r; +static CYTHON_INLINE PyObject *__pyx_f_5numpy_5dtype_6fields_fields(PyArray_Descr *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1; + __Pyx_RefNannySetupContext("fields", 1); - /* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":260 - * """Returns the number of dimensions in the array. - * """ - * return PyArray_NDIM(self) # <<<<<<<<<<<<<< + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":297 + * @property + * cdef inline object fields(self): + * return PyDataType_FIELDS(self) # <<<<<<<<<<<<<< * * @property */ - __pyx_r = PyArray_NDIM(__pyx_v_self); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyDataType_FIELDS(__pyx_v_self); + __Pyx_INCREF(((PyObject *)__pyx_t_1)); + __pyx_r = ((PyObject *)__pyx_t_1); goto __pyx_L0; - /* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":257 - * + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":296 + * # for this using PyDataType_HASFIELDS. * @property - * cdef inline int ndim(self) nogil: # <<<<<<<<<<<<<< - * """Returns the number of dimensions in the array. - * """ + * cdef inline object fields(self): # <<<<<<<<<<<<<< + * return PyDataType_FIELDS(self) + * */ /* function exit code */ __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":263 +/* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":300 * * @property - * cdef inline npy_intp *shape(self) nogil: # <<<<<<<<<<<<<< - * """Returns a pointer to the dimensions/shape of the array. - * The number of elements matches the number of dimensions of the array (ndim). + * cdef inline tuple names(self): # <<<<<<<<<<<<<< + * return PyDataType_NAMES(self) + * */ -static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_5shape_shape(PyArrayObject *__pyx_v_self) { - npy_intp *__pyx_r; +static CYTHON_INLINE PyObject *__pyx_f_5numpy_5dtype_5names_names(PyArray_Descr *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1; + __Pyx_RefNannySetupContext("names", 1); - /* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":268 - * Can return NULL for 0-dimensional arrays. - * """ - * return PyArray_DIMS(self) # <<<<<<<<<<<<<< - * + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":301 * @property + * cdef inline tuple names(self): + * return PyDataType_NAMES(self) # <<<<<<<<<<<<<< + * + * # Use PyDataType_HASSUBARRAY to test whether this field is */ - __pyx_r = PyArray_DIMS(__pyx_v_self); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyDataType_NAMES(__pyx_v_self); + __Pyx_INCREF(((PyObject*)__pyx_t_1)); + __pyx_r = ((PyObject*)__pyx_t_1); goto __pyx_L0; - /* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":263 + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":300 * * @property - * cdef inline npy_intp *shape(self) nogil: # <<<<<<<<<<<<<< - * """Returns a pointer to the dimensions/shape of the array. - * The number of elements matches the number of dimensions of the array (ndim). + * cdef inline tuple names(self): # <<<<<<<<<<<<<< + * return PyDataType_NAMES(self) + * */ /* function exit code */ __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":271 - * +/* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":307 + * # this field via the inline helper method PyDataType_SHAPE. * @property - * cdef inline npy_intp *strides(self) nogil: # <<<<<<<<<<<<<< - * """Returns a pointer to the strides of the array. - * The number of elements matches the number of dimensions of the array (ndim). + * cdef inline PyArray_ArrayDescr* subarray(self) noexcept nogil: # <<<<<<<<<<<<<< + * return PyDataType_SUBARRAY(self) + * */ -static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_7strides_strides(PyArrayObject *__pyx_v_self) { - npy_intp *__pyx_r; +static CYTHON_INLINE PyArray_ArrayDescr *__pyx_f_5numpy_5dtype_8subarray_subarray(PyArray_Descr *__pyx_v_self) { + PyArray_ArrayDescr *__pyx_r; - /* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":275 - * The number of elements matches the number of dimensions of the array (ndim). - * """ - * return PyArray_STRIDES(self) # <<<<<<<<<<<<<< + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":308 + * @property + * cdef inline PyArray_ArrayDescr* subarray(self) noexcept nogil: + * return PyDataType_SUBARRAY(self) # <<<<<<<<<<<<<< * * @property */ - __pyx_r = PyArray_STRIDES(__pyx_v_self); + __pyx_r = PyDataType_SUBARRAY(__pyx_v_self); goto __pyx_L0; - /* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":271 - * + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":307 + * # this field via the inline helper method PyDataType_SHAPE. * @property - * cdef inline npy_intp *strides(self) nogil: # <<<<<<<<<<<<<< - * """Returns a pointer to the strides of the array. - * The number of elements matches the number of dimensions of the array (ndim). + * cdef inline PyArray_ArrayDescr* subarray(self) noexcept nogil: # <<<<<<<<<<<<<< + * return PyDataType_SUBARRAY(self) + * */ /* function exit code */ @@ -18410,33 +18503,33 @@ static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_7strides_strides(PyArrayO return __pyx_r; } -/* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":278 +/* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":311 * * @property - * cdef inline npy_intp size(self) nogil: # <<<<<<<<<<<<<< - * """Returns the total size (in number of elements) of the array. - * """ + * cdef inline npy_uint64 flags(self) noexcept nogil: # <<<<<<<<<<<<<< + * """The data types flags.""" + * return PyDataType_FLAGS(self) */ -static CYTHON_INLINE npy_intp __pyx_f_5numpy_7ndarray_4size_size(PyArrayObject *__pyx_v_self) { - npy_intp __pyx_r; +static CYTHON_INLINE npy_uint64 __pyx_f_5numpy_5dtype_5flags_flags(PyArray_Descr *__pyx_v_self) { + npy_uint64 __pyx_r; - /* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":281 - * """Returns the total size (in number of elements) of the array. - * """ - * return PyArray_SIZE(self) # <<<<<<<<<<<<<< + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":313 + * cdef inline npy_uint64 flags(self) noexcept nogil: + * """The data types flags.""" + * return PyDataType_FLAGS(self) # <<<<<<<<<<<<<< + * * - * @property */ - __pyx_r = PyArray_SIZE(__pyx_v_self); + __pyx_r = PyDataType_FLAGS(__pyx_v_self); goto __pyx_L0; - /* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":278 + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":311 * * @property - * cdef inline npy_intp size(self) nogil: # <<<<<<<<<<<<<< - * """Returns the total size (in number of elements) of the array. - * """ + * cdef inline npy_uint64 flags(self) noexcept nogil: # <<<<<<<<<<<<<< + * """The data types flags.""" + * return PyDataType_FLAGS(self) */ /* function exit code */ @@ -18444,33 +18537,33 @@ static CYTHON_INLINE npy_intp __pyx_f_5numpy_7ndarray_4size_size(PyArrayObject * return __pyx_r; } -/* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":284 +/* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":323 * * @property - * cdef inline char* data(self) nogil: # <<<<<<<<<<<<<< - * """The pointer to the data buffer as a char*. - * This is provided for legacy reasons to avoid direct struct field access. + * cdef inline int numiter(self) noexcept nogil: # <<<<<<<<<<<<<< + * """The number of arrays that need to be broadcast to the same shape.""" + * return PyArray_MultiIter_NUMITER(self) */ -static CYTHON_INLINE char *__pyx_f_5numpy_7ndarray_4data_data(PyArrayObject *__pyx_v_self) { - char *__pyx_r; +static CYTHON_INLINE int __pyx_f_5numpy_9broadcast_7numiter_numiter(PyArrayMultiIterObject *__pyx_v_self) { + int __pyx_r; - /* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":290 - * of `PyArray_DATA()` instead, which returns a 'void*'. - * """ - * return PyArray_BYTES(self) # <<<<<<<<<<<<<< + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":325 + * cdef inline int numiter(self) noexcept nogil: + * """The number of arrays that need to be broadcast to the same shape.""" + * return PyArray_MultiIter_NUMITER(self) # <<<<<<<<<<<<<< * - * ctypedef unsigned char npy_bool + * @property */ - __pyx_r = PyArray_BYTES(__pyx_v_self); + __pyx_r = PyArray_MultiIter_NUMITER(__pyx_v_self); goto __pyx_L0; - /* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":284 + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":323 * * @property - * cdef inline char* data(self) nogil: # <<<<<<<<<<<<<< - * """The pointer to the data buffer as a char*. - * This is provided for legacy reasons to avoid direct struct field access. + * cdef inline int numiter(self) noexcept nogil: # <<<<<<<<<<<<<< + * """The number of arrays that need to be broadcast to the same shape.""" + * return PyArray_MultiIter_NUMITER(self) */ /* function exit code */ @@ -18478,61 +18571,477 @@ static CYTHON_INLINE char *__pyx_f_5numpy_7ndarray_4data_data(PyArrayObject *__p return __pyx_r; } -/* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":773 - * ctypedef npy_cdouble complex_t - * - * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(1, a) +/* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":328 * + * @property + * cdef inline npy_intp size(self) noexcept nogil: # <<<<<<<<<<<<<< + * """The total broadcasted size.""" + * return PyArray_MultiIter_SIZE(self) */ -static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 1); +static CYTHON_INLINE npy_intp __pyx_f_5numpy_9broadcast_4size_size(PyArrayMultiIterObject *__pyx_v_self) { + npy_intp __pyx_r; - /* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":774 - * - * cdef inline object PyArray_MultiIterNew1(a): - * return PyArray_MultiIterNew(1, a) # <<<<<<<<<<<<<< + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":330 + * cdef inline npy_intp size(self) noexcept nogil: + * """The total broadcasted size.""" + * return PyArray_MultiIter_SIZE(self) # <<<<<<<<<<<<<< * - * cdef inline object PyArray_MultiIterNew2(a, b): + * @property */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 774, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; + __pyx_r = PyArray_MultiIter_SIZE(__pyx_v_self); goto __pyx_L0; - /* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":773 - * ctypedef npy_cdouble complex_t - * - * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(1, a) + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":328 * + * @property + * cdef inline npy_intp size(self) noexcept nogil: # <<<<<<<<<<<<<< + * """The total broadcasted size.""" + * return PyArray_MultiIter_SIZE(self) */ /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":776 - * return PyArray_MultiIterNew(1, a) +/* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":333 * - * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(2, a, b) + * @property + * cdef inline npy_intp index(self) noexcept nogil: # <<<<<<<<<<<<<< + * """The current (1-d) index into the broadcasted result.""" + * return PyArray_MultiIter_INDEX(self) + */ + +static CYTHON_INLINE npy_intp __pyx_f_5numpy_9broadcast_5index_index(PyArrayMultiIterObject *__pyx_v_self) { + npy_intp __pyx_r; + + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":335 + * cdef inline npy_intp index(self) noexcept nogil: + * """The current (1-d) index into the broadcasted result.""" + * return PyArray_MultiIter_INDEX(self) # <<<<<<<<<<<<<< + * + * @property + */ + __pyx_r = PyArray_MultiIter_INDEX(__pyx_v_self); + goto __pyx_L0; + + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":333 + * + * @property + * cdef inline npy_intp index(self) noexcept nogil: # <<<<<<<<<<<<<< + * """The current (1-d) index into the broadcasted result.""" + * return PyArray_MultiIter_INDEX(self) + */ + + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":338 + * + * @property + * cdef inline int nd(self) noexcept nogil: # <<<<<<<<<<<<<< + * """The number of dimensions in the broadcasted result.""" + * return PyArray_MultiIter_NDIM(self) + */ + +static CYTHON_INLINE int __pyx_f_5numpy_9broadcast_2nd_nd(PyArrayMultiIterObject *__pyx_v_self) { + int __pyx_r; + + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":340 + * cdef inline int nd(self) noexcept nogil: + * """The number of dimensions in the broadcasted result.""" + * return PyArray_MultiIter_NDIM(self) # <<<<<<<<<<<<<< + * + * @property + */ + __pyx_r = PyArray_MultiIter_NDIM(__pyx_v_self); + goto __pyx_L0; + + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":338 + * + * @property + * cdef inline int nd(self) noexcept nogil: # <<<<<<<<<<<<<< + * """The number of dimensions in the broadcasted result.""" + * return PyArray_MultiIter_NDIM(self) + */ + + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":343 + * + * @property + * cdef inline npy_intp* dimensions(self) noexcept nogil: # <<<<<<<<<<<<<< + * """The shape of the broadcasted result.""" + * return PyArray_MultiIter_DIMS(self) + */ + +static CYTHON_INLINE npy_intp *__pyx_f_5numpy_9broadcast_10dimensions_dimensions(PyArrayMultiIterObject *__pyx_v_self) { + npy_intp *__pyx_r; + + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":345 + * cdef inline npy_intp* dimensions(self) noexcept nogil: + * """The shape of the broadcasted result.""" + * return PyArray_MultiIter_DIMS(self) # <<<<<<<<<<<<<< + * + * @property + */ + __pyx_r = PyArray_MultiIter_DIMS(__pyx_v_self); + goto __pyx_L0; + + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":343 + * + * @property + * cdef inline npy_intp* dimensions(self) noexcept nogil: # <<<<<<<<<<<<<< + * """The shape of the broadcasted result.""" + * return PyArray_MultiIter_DIMS(self) + */ + + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":348 + * + * @property + * cdef inline void** iters(self) noexcept nogil: # <<<<<<<<<<<<<< + * """An array of iterator objects that holds the iterators for the arrays to be broadcast together. + * On return, the iterators are adjusted for broadcasting.""" + */ + +static CYTHON_INLINE void **__pyx_f_5numpy_9broadcast_5iters_iters(PyArrayMultiIterObject *__pyx_v_self) { + void **__pyx_r; + + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":351 + * """An array of iterator objects that holds the iterators for the arrays to be broadcast together. + * On return, the iterators are adjusted for broadcasting.""" + * return PyArray_MultiIter_ITERS(self) # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = PyArray_MultiIter_ITERS(__pyx_v_self); + goto __pyx_L0; + + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":348 + * + * @property + * cdef inline void** iters(self) noexcept nogil: # <<<<<<<<<<<<<< + * """An array of iterator objects that holds the iterators for the arrays to be broadcast together. + * On return, the iterators are adjusted for broadcasting.""" + */ + + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":366 + * + * @property + * cdef inline PyObject* base(self) noexcept nogil: # <<<<<<<<<<<<<< + * """Returns a borrowed reference to the object owning the data/memory. + * """ + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_7ndarray_4base_base(PyArrayObject *__pyx_v_self) { + PyObject *__pyx_r; + + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":369 + * """Returns a borrowed reference to the object owning the data/memory. + * """ + * return PyArray_BASE(self) # <<<<<<<<<<<<<< + * + * @property + */ + __pyx_r = PyArray_BASE(__pyx_v_self); + goto __pyx_L0; + + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":366 + * + * @property + * cdef inline PyObject* base(self) noexcept nogil: # <<<<<<<<<<<<<< + * """Returns a borrowed reference to the object owning the data/memory. + * """ + */ + + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":372 + * + * @property + * cdef inline dtype descr(self): # <<<<<<<<<<<<<< + * """Returns an owned reference to the dtype of the array. + * """ + */ + +static CYTHON_INLINE PyArray_Descr *__pyx_f_5numpy_7ndarray_5descr_descr(PyArrayObject *__pyx_v_self) { + PyArray_Descr *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyArray_Descr *__pyx_t_1; + __Pyx_RefNannySetupContext("descr", 1); + + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":375 + * """Returns an owned reference to the dtype of the array. + * """ + * return PyArray_DESCR(self) # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF((PyObject *)__pyx_r); + __pyx_t_1 = PyArray_DESCR(__pyx_v_self); + __Pyx_INCREF((PyObject *)((PyArray_Descr *)__pyx_t_1)); + __pyx_r = ((PyArray_Descr *)__pyx_t_1); + goto __pyx_L0; + + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":372 + * + * @property + * cdef inline dtype descr(self): # <<<<<<<<<<<<<< + * """Returns an owned reference to the dtype of the array. + * """ + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF((PyObject *)__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":378 + * + * @property + * cdef inline int ndim(self) noexcept nogil: # <<<<<<<<<<<<<< + * """Returns the number of dimensions in the array. + * """ + */ + +static CYTHON_INLINE int __pyx_f_5numpy_7ndarray_4ndim_ndim(PyArrayObject *__pyx_v_self) { + int __pyx_r; + + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":381 + * """Returns the number of dimensions in the array. + * """ + * return PyArray_NDIM(self) # <<<<<<<<<<<<<< + * + * @property + */ + __pyx_r = PyArray_NDIM(__pyx_v_self); + goto __pyx_L0; + + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":378 + * + * @property + * cdef inline int ndim(self) noexcept nogil: # <<<<<<<<<<<<<< + * """Returns the number of dimensions in the array. + * """ + */ + + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":384 + * + * @property + * cdef inline npy_intp *shape(self) noexcept nogil: # <<<<<<<<<<<<<< + * """Returns a pointer to the dimensions/shape of the array. + * The number of elements matches the number of dimensions of the array (ndim). + */ + +static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_5shape_shape(PyArrayObject *__pyx_v_self) { + npy_intp *__pyx_r; + + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":389 + * Can return NULL for 0-dimensional arrays. + * """ + * return PyArray_DIMS(self) # <<<<<<<<<<<<<< + * + * @property + */ + __pyx_r = PyArray_DIMS(__pyx_v_self); + goto __pyx_L0; + + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":384 + * + * @property + * cdef inline npy_intp *shape(self) noexcept nogil: # <<<<<<<<<<<<<< + * """Returns a pointer to the dimensions/shape of the array. + * The number of elements matches the number of dimensions of the array (ndim). + */ + + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":392 + * + * @property + * cdef inline npy_intp *strides(self) noexcept nogil: # <<<<<<<<<<<<<< + * """Returns a pointer to the strides of the array. + * The number of elements matches the number of dimensions of the array (ndim). + */ + +static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_7strides_strides(PyArrayObject *__pyx_v_self) { + npy_intp *__pyx_r; + + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":396 + * The number of elements matches the number of dimensions of the array (ndim). + * """ + * return PyArray_STRIDES(self) # <<<<<<<<<<<<<< + * + * @property + */ + __pyx_r = PyArray_STRIDES(__pyx_v_self); + goto __pyx_L0; + + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":392 + * + * @property + * cdef inline npy_intp *strides(self) noexcept nogil: # <<<<<<<<<<<<<< + * """Returns a pointer to the strides of the array. + * The number of elements matches the number of dimensions of the array (ndim). + */ + + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":399 + * + * @property + * cdef inline npy_intp size(self) noexcept nogil: # <<<<<<<<<<<<<< + * """Returns the total size (in number of elements) of the array. + * """ + */ + +static CYTHON_INLINE npy_intp __pyx_f_5numpy_7ndarray_4size_size(PyArrayObject *__pyx_v_self) { + npy_intp __pyx_r; + + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":402 + * """Returns the total size (in number of elements) of the array. + * """ + * return PyArray_SIZE(self) # <<<<<<<<<<<<<< + * + * @property + */ + __pyx_r = PyArray_SIZE(__pyx_v_self); + goto __pyx_L0; + + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":399 + * + * @property + * cdef inline npy_intp size(self) noexcept nogil: # <<<<<<<<<<<<<< + * """Returns the total size (in number of elements) of the array. + * """ + */ + + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":405 + * + * @property + * cdef inline char* data(self) noexcept nogil: # <<<<<<<<<<<<<< + * """The pointer to the data buffer as a char*. + * This is provided for legacy reasons to avoid direct struct field access. + */ + +static CYTHON_INLINE char *__pyx_f_5numpy_7ndarray_4data_data(PyArrayObject *__pyx_v_self) { + char *__pyx_r; + + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":411 + * of `PyArray_DATA()` instead, which returns a 'void*'. + * """ + * return PyArray_BYTES(self) # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = PyArray_BYTES(__pyx_v_self); + goto __pyx_L0; + + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":405 + * + * @property + * cdef inline char* data(self) noexcept nogil: # <<<<<<<<<<<<<< + * """The pointer to the data buffer as a char*. + * This is provided for legacy reasons to avoid direct struct field access. + */ + + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":806 + * ctypedef long double complex clongdouble_t + * + * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(1, a) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 1); + + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":807 + * + * cdef inline object PyArray_MultiIterNew1(a): + * return PyArray_MultiIterNew(1, a) # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew2(a, b): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 807, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":806 + * ctypedef long double complex clongdouble_t + * + * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(1, a) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":809 + * return PyArray_MultiIterNew(1, a) + * + * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(2, a, b) * */ @@ -18545,7 +19054,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 1); - /* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":777 + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":810 * * cdef inline object PyArray_MultiIterNew2(a, b): * return PyArray_MultiIterNew(2, a, b) # <<<<<<<<<<<<<< @@ -18553,13 +19062,13 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ * cdef inline object PyArray_MultiIterNew3(a, b, c): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 777, __pyx_L1_error) + __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 810, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":776 + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":809 * return PyArray_MultiIterNew(1, a) * * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< @@ -18578,7 +19087,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ return __pyx_r; } -/* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":779 +/* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":812 * return PyArray_MultiIterNew(2, a, b) * * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< @@ -18595,7 +19104,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 1); - /* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":780 + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":813 * * cdef inline object PyArray_MultiIterNew3(a, b, c): * return PyArray_MultiIterNew(3, a, b, c) # <<<<<<<<<<<<<< @@ -18603,13 +19112,13 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ * cdef inline object PyArray_MultiIterNew4(a, b, c, d): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 780, __pyx_L1_error) + __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 813, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":779 + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":812 * return PyArray_MultiIterNew(2, a, b) * * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< @@ -18628,7 +19137,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ return __pyx_r; } -/* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":782 +/* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":815 * return PyArray_MultiIterNew(3, a, b, c) * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< @@ -18645,7 +19154,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 1); - /* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":783 + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":816 * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): * return PyArray_MultiIterNew(4, a, b, c, d) # <<<<<<<<<<<<<< @@ -18653,13 +19162,13 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 783, __pyx_L1_error) + __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 816, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":782 + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":815 * return PyArray_MultiIterNew(3, a, b, c) * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< @@ -18678,7 +19187,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ return __pyx_r; } -/* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":785 +/* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":818 * return PyArray_MultiIterNew(4, a, b, c, d) * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< @@ -18695,7 +19204,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 1); - /* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":786 + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":819 * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): * return PyArray_MultiIterNew(5, a, b, c, d, e) # <<<<<<<<<<<<<< @@ -18703,13 +19212,13 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ * cdef inline tuple PyDataType_SHAPE(dtype d): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 786, __pyx_L1_error) + __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 819, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":785 + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":818 * return PyArray_MultiIterNew(4, a, b, c, d) * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< @@ -18728,7 +19237,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ return __pyx_r; } -/* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":788 +/* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":821 * return PyArray_MultiIterNew(5, a, b, c, d, e) * * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<< @@ -18740,9 +19249,10 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; + PyObject *__pyx_t_2; __Pyx_RefNannySetupContext("PyDataType_SHAPE", 1); - /* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":789 + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":822 * * cdef inline tuple PyDataType_SHAPE(dtype d): * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<< @@ -18752,7 +19262,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ __pyx_t_1 = PyDataType_HASSUBARRAY(__pyx_v_d); if (__pyx_t_1) { - /* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":790 + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":823 * cdef inline tuple PyDataType_SHAPE(dtype d): * if PyDataType_HASSUBARRAY(d): * return d.subarray.shape # <<<<<<<<<<<<<< @@ -18760,11 +19270,12 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ * return () */ __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject*)__pyx_v_d->subarray->shape)); - __pyx_r = ((PyObject*)__pyx_v_d->subarray->shape); + __pyx_t_2 = __pyx_f_5numpy_5dtype_8subarray_subarray(__pyx_v_d)->shape; + __Pyx_INCREF(((PyObject*)__pyx_t_2)); + __pyx_r = ((PyObject*)__pyx_t_2); goto __pyx_L0; - /* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":789 + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":822 * * cdef inline tuple PyDataType_SHAPE(dtype d): * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<< @@ -18773,7 +19284,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ */ } - /* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":792 + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":825 * return d.subarray.shape * else: * return () # <<<<<<<<<<<<<< @@ -18787,7 +19298,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ goto __pyx_L0; } - /* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":788 + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":821 * return PyArray_MultiIterNew(5, a, b, c, d, e) * * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<< @@ -18802,10 +19313,10 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ return __pyx_r; } -/* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":967 +/* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1009 * int _import_umath() except -1 * - * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< + * cdef inline void set_array_base(ndarray arr, object base) except *: # <<<<<<<<<<<<<< * Py_INCREF(base) # important to do this before stealing the reference below! * PyArray_SetBaseObject(arr, base) */ @@ -18816,28 +19327,28 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a const char *__pyx_filename = NULL; int __pyx_clineno = 0; - /* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":968 + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1010 * - * cdef inline void set_array_base(ndarray arr, object base): + * cdef inline void set_array_base(ndarray arr, object base) except *: * Py_INCREF(base) # important to do this before stealing the reference below! # <<<<<<<<<<<<<< * PyArray_SetBaseObject(arr, base) * */ Py_INCREF(__pyx_v_base); - /* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":969 - * cdef inline void set_array_base(ndarray arr, object base): + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1011 + * cdef inline void set_array_base(ndarray arr, object base) except *: * Py_INCREF(base) # important to do this before stealing the reference below! * PyArray_SetBaseObject(arr, base) # <<<<<<<<<<<<<< * * cdef inline object get_array_base(ndarray arr): */ - __pyx_t_1 = PyArray_SetBaseObject(__pyx_v_arr, __pyx_v_base); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(2, 969, __pyx_L1_error) + __pyx_t_1 = PyArray_SetBaseObject(__pyx_v_arr, __pyx_v_base); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(2, 1011, __pyx_L1_error) - /* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":967 + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1009 * int _import_umath() except -1 * - * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< + * cdef inline void set_array_base(ndarray arr, object base) except *: # <<<<<<<<<<<<<< * Py_INCREF(base) # important to do this before stealing the reference below! * PyArray_SetBaseObject(arr, base) */ @@ -18849,7 +19360,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a __pyx_L0:; } -/* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":971 +/* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1013 * PyArray_SetBaseObject(arr, base) * * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< @@ -18864,7 +19375,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py int __pyx_t_1; __Pyx_RefNannySetupContext("get_array_base", 1); - /* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":972 + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1014 * * cdef inline object get_array_base(ndarray arr): * base = PyArray_BASE(arr) # <<<<<<<<<<<<<< @@ -18873,7 +19384,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py */ __pyx_v_base = PyArray_BASE(__pyx_v_arr); - /* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":973 + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1015 * cdef inline object get_array_base(ndarray arr): * base = PyArray_BASE(arr) * if base is NULL: # <<<<<<<<<<<<<< @@ -18883,7 +19394,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py __pyx_t_1 = (__pyx_v_base == NULL); if (__pyx_t_1) { - /* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":974 + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1016 * base = PyArray_BASE(arr) * if base is NULL: * return None # <<<<<<<<<<<<<< @@ -18894,7 +19405,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - /* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":973 + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1015 * cdef inline object get_array_base(ndarray arr): * base = PyArray_BASE(arr) * if base is NULL: # <<<<<<<<<<<<<< @@ -18903,7 +19414,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py */ } - /* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":975 + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1017 * if base is NULL: * return None * return base # <<<<<<<<<<<<<< @@ -18915,7 +19426,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py __pyx_r = ((PyObject *)__pyx_v_base); goto __pyx_L0; - /* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":971 + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1013 * PyArray_SetBaseObject(arr, base) * * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< @@ -18930,7 +19441,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py return __pyx_r; } -/* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":979 +/* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1021 * # Versions of the import_* functions which are more suitable for * # Cython code. * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< @@ -18954,7 +19465,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { int __pyx_clineno = 0; __Pyx_RefNannySetupContext("import_array", 1); - /* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":980 + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1022 * # Cython code. * cdef inline int import_array() except -1: * try: # <<<<<<<<<<<<<< @@ -18970,16 +19481,16 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { - /* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":981 + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1023 * cdef inline int import_array() except -1: * try: * __pyx_import_array() # <<<<<<<<<<<<<< * except Exception: - * raise ImportError("numpy.core.multiarray failed to import") + * raise ImportError("numpy._core.multiarray failed to import") */ - __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 981, __pyx_L3_error) + __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 1023, __pyx_L3_error) - /* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":980 + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1022 * # Cython code. * cdef inline int import_array() except -1: * try: # <<<<<<<<<<<<<< @@ -18993,37 +19504,37 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { goto __pyx_L8_try_end; __pyx_L3_error:; - /* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":982 + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1024 * try: * __pyx_import_array() * except Exception: # <<<<<<<<<<<<<< - * raise ImportError("numpy.core.multiarray failed to import") + * raise ImportError("numpy._core.multiarray failed to import") * */ __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); if (__pyx_t_4) { __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 982, __pyx_L5_except_error) + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 1024, __pyx_L5_except_error) __Pyx_XGOTREF(__pyx_t_5); __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_7); - /* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":983 + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1025 * __pyx_import_array() * except Exception: - * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<< + * raise ImportError("numpy._core.multiarray failed to import") # <<<<<<<<<<<<<< * * cdef inline int import_umath() except -1: */ - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 983, __pyx_L5_except_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1025, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_Raise(__pyx_t_8, 0, 0, 0); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __PYX_ERR(2, 983, __pyx_L5_except_error) + __PYX_ERR(2, 1025, __pyx_L5_except_error) } goto __pyx_L5_except_error; - /* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":980 + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1022 * # Cython code. * cdef inline int import_array() except -1: * try: # <<<<<<<<<<<<<< @@ -19039,7 +19550,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { __pyx_L8_try_end:; } - /* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":979 + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1021 * # Versions of the import_* functions which are more suitable for * # Cython code. * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< @@ -19062,8 +19573,8 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { return __pyx_r; } -/* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":985 - * raise ImportError("numpy.core.multiarray failed to import") +/* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1027 + * raise ImportError("numpy._core.multiarray failed to import") * * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< * try: @@ -19086,7 +19597,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { int __pyx_clineno = 0; __Pyx_RefNannySetupContext("import_umath", 1); - /* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":986 + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1028 * * cdef inline int import_umath() except -1: * try: # <<<<<<<<<<<<<< @@ -19102,16 +19613,16 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { - /* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":987 + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1029 * cdef inline int import_umath() except -1: * try: * _import_umath() # <<<<<<<<<<<<<< * except Exception: - * raise ImportError("numpy.core.umath failed to import") + * raise ImportError("numpy._core.umath failed to import") */ - __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 987, __pyx_L3_error) + __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 1029, __pyx_L3_error) - /* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":986 + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1028 * * cdef inline int import_umath() except -1: * try: # <<<<<<<<<<<<<< @@ -19125,37 +19636,37 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { goto __pyx_L8_try_end; __pyx_L3_error:; - /* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":988 + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1030 * try: * _import_umath() * except Exception: # <<<<<<<<<<<<<< - * raise ImportError("numpy.core.umath failed to import") + * raise ImportError("numpy._core.umath failed to import") * */ __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); if (__pyx_t_4) { __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 988, __pyx_L5_except_error) + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 1030, __pyx_L5_except_error) __Pyx_XGOTREF(__pyx_t_5); __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_7); - /* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":989 + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1031 * _import_umath() * except Exception: - * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< + * raise ImportError("numpy._core.umath failed to import") # <<<<<<<<<<<<<< * * cdef inline int import_ufunc() except -1: */ - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 989, __pyx_L5_except_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1031, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_Raise(__pyx_t_8, 0, 0, 0); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __PYX_ERR(2, 989, __pyx_L5_except_error) + __PYX_ERR(2, 1031, __pyx_L5_except_error) } goto __pyx_L5_except_error; - /* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":986 + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1028 * * cdef inline int import_umath() except -1: * try: # <<<<<<<<<<<<<< @@ -19171,8 +19682,8 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { __pyx_L8_try_end:; } - /* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":985 - * raise ImportError("numpy.core.multiarray failed to import") + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1027 + * raise ImportError("numpy._core.multiarray failed to import") * * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< * try: @@ -19194,8 +19705,8 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { return __pyx_r; } -/* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":991 - * raise ImportError("numpy.core.umath failed to import") +/* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1033 + * raise ImportError("numpy._core.umath failed to import") * * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< * try: @@ -19218,7 +19729,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { int __pyx_clineno = 0; __Pyx_RefNannySetupContext("import_ufunc", 1); - /* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":992 + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1034 * * cdef inline int import_ufunc() except -1: * try: # <<<<<<<<<<<<<< @@ -19234,16 +19745,16 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { - /* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":993 + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1035 * cdef inline int import_ufunc() except -1: * try: * _import_umath() # <<<<<<<<<<<<<< * except Exception: - * raise ImportError("numpy.core.umath failed to import") + * raise ImportError("numpy._core.umath failed to import") */ - __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 993, __pyx_L3_error) + __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 1035, __pyx_L3_error) - /* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":992 + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1034 * * cdef inline int import_ufunc() except -1: * try: # <<<<<<<<<<<<<< @@ -19257,37 +19768,37 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { goto __pyx_L8_try_end; __pyx_L3_error:; - /* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":994 + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1036 * try: * _import_umath() * except Exception: # <<<<<<<<<<<<<< - * raise ImportError("numpy.core.umath failed to import") + * raise ImportError("numpy._core.umath failed to import") * */ __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); if (__pyx_t_4) { __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 994, __pyx_L5_except_error) + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 1036, __pyx_L5_except_error) __Pyx_XGOTREF(__pyx_t_5); __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_7); - /* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":995 + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1037 * _import_umath() * except Exception: - * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< + * raise ImportError("numpy._core.umath failed to import") # <<<<<<<<<<<<<< * * */ - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 995, __pyx_L5_except_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1037, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_Raise(__pyx_t_8, 0, 0, 0); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __PYX_ERR(2, 995, __pyx_L5_except_error) + __PYX_ERR(2, 1037, __pyx_L5_except_error) } goto __pyx_L5_except_error; - /* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":992 + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1034 * * cdef inline int import_ufunc() except -1: * try: # <<<<<<<<<<<<<< @@ -19303,8 +19814,8 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { __pyx_L8_try_end:; } - /* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":991 - * raise ImportError("numpy.core.umath failed to import") + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1033 + * raise ImportError("numpy._core.umath failed to import") * * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< * try: @@ -19326,10 +19837,10 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { return __pyx_r; } -/* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":998 +/* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1040 * * - * cdef inline bint is_timedelta64_object(object obj): # <<<<<<<<<<<<<< + * cdef inline bint is_timedelta64_object(object obj) noexcept: # <<<<<<<<<<<<<< * """ * Cython equivalent of `isinstance(obj, np.timedelta64)` */ @@ -19337,7 +19848,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { static CYTHON_INLINE int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_obj) { int __pyx_r; - /* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1010 + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1052 * bool * """ * return PyObject_TypeCheck(obj, &PyTimedeltaArrType_Type) # <<<<<<<<<<<<<< @@ -19347,10 +19858,10 @@ static CYTHON_INLINE int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_ __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyTimedeltaArrType_Type)); goto __pyx_L0; - /* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":998 + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1040 * * - * cdef inline bint is_timedelta64_object(object obj): # <<<<<<<<<<<<<< + * cdef inline bint is_timedelta64_object(object obj) noexcept: # <<<<<<<<<<<<<< * """ * Cython equivalent of `isinstance(obj, np.timedelta64)` */ @@ -19360,10 +19871,10 @@ static CYTHON_INLINE int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_ return __pyx_r; } -/* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1013 +/* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1055 * * - * cdef inline bint is_datetime64_object(object obj): # <<<<<<<<<<<<<< + * cdef inline bint is_datetime64_object(object obj) noexcept: # <<<<<<<<<<<<<< * """ * Cython equivalent of `isinstance(obj, np.datetime64)` */ @@ -19371,7 +19882,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_ static CYTHON_INLINE int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_obj) { int __pyx_r; - /* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1025 + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1067 * bool * """ * return PyObject_TypeCheck(obj, &PyDatetimeArrType_Type) # <<<<<<<<<<<<<< @@ -19381,10 +19892,10 @@ static CYTHON_INLINE int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_o __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyDatetimeArrType_Type)); goto __pyx_L0; - /* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1013 + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1055 * * - * cdef inline bint is_datetime64_object(object obj): # <<<<<<<<<<<<<< + * cdef inline bint is_datetime64_object(object obj) noexcept: # <<<<<<<<<<<<<< * """ * Cython equivalent of `isinstance(obj, np.datetime64)` */ @@ -19394,10 +19905,10 @@ static CYTHON_INLINE int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_o return __pyx_r; } -/* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1028 +/* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1070 * * - * cdef inline npy_datetime get_datetime64_value(object obj) nogil: # <<<<<<<<<<<<<< + * cdef inline npy_datetime get_datetime64_value(object obj) noexcept nogil: # <<<<<<<<<<<<<< * """ * returns the int64 value underlying scalar numpy datetime64 object */ @@ -19405,7 +19916,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_o static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject *__pyx_v_obj) { npy_datetime __pyx_r; - /* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1035 + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1077 * also needed. That can be found using `get_datetime64_unit`. * """ * return (obj).obval # <<<<<<<<<<<<<< @@ -19415,10 +19926,10 @@ static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject * __pyx_r = ((PyDatetimeScalarObject *)__pyx_v_obj)->obval; goto __pyx_L0; - /* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1028 + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1070 * * - * cdef inline npy_datetime get_datetime64_value(object obj) nogil: # <<<<<<<<<<<<<< + * cdef inline npy_datetime get_datetime64_value(object obj) noexcept nogil: # <<<<<<<<<<<<<< * """ * returns the int64 value underlying scalar numpy datetime64 object */ @@ -19428,10 +19939,10 @@ static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject * return __pyx_r; } -/* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1038 +/* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1080 * * - * cdef inline npy_timedelta get_timedelta64_value(object obj) nogil: # <<<<<<<<<<<<<< + * cdef inline npy_timedelta get_timedelta64_value(object obj) noexcept nogil: # <<<<<<<<<<<<<< * """ * returns the int64 value underlying scalar numpy timedelta64 object */ @@ -19439,7 +19950,7 @@ static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject * static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject *__pyx_v_obj) { npy_timedelta __pyx_r; - /* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1042 + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1084 * returns the int64 value underlying scalar numpy timedelta64 object * """ * return (obj).obval # <<<<<<<<<<<<<< @@ -19449,10 +19960,10 @@ static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject __pyx_r = ((PyTimedeltaScalarObject *)__pyx_v_obj)->obval; goto __pyx_L0; - /* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1038 + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1080 * * - * cdef inline npy_timedelta get_timedelta64_value(object obj) nogil: # <<<<<<<<<<<<<< + * cdef inline npy_timedelta get_timedelta64_value(object obj) noexcept nogil: # <<<<<<<<<<<<<< * """ * returns the int64 value underlying scalar numpy timedelta64 object */ @@ -19462,10 +19973,10 @@ static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject return __pyx_r; } -/* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1045 +/* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1087 * * - * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) nogil: # <<<<<<<<<<<<<< + * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) noexcept nogil: # <<<<<<<<<<<<<< * """ * returns the unit part of the dtype for a numpy datetime64 object. */ @@ -19473,18 +19984,20 @@ static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject static CYTHON_INLINE NPY_DATETIMEUNIT __pyx_f_5numpy_get_datetime64_unit(PyObject *__pyx_v_obj) { NPY_DATETIMEUNIT __pyx_r; - /* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1049 + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1091 * returns the unit part of the dtype for a numpy datetime64 object. * """ * return (obj).obmeta.base # <<<<<<<<<<<<<< + * + * */ __pyx_r = ((NPY_DATETIMEUNIT)((PyDatetimeScalarObject *)__pyx_v_obj)->obmeta.base); goto __pyx_L0; - /* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1045 + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1087 * * - * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) nogil: # <<<<<<<<<<<<<< + * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) noexcept nogil: # <<<<<<<<<<<<<< * """ * returns the unit part of the dtype for a numpy datetime64 object. */ @@ -19920,7 +20433,7 @@ static PyObject *__pyx_f_7fastkde_15floodFillSearch_findNeighbors(__pyx_t_5numpy int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; - int __pyx_t_6; + unsigned int __pyx_t_6; __pyx_t_5numpy_int64_t __pyx_t_7; __pyx_t_5numpy_int64_t __pyx_t_8; __pyx_t_5numpy_int64_t __pyx_t_9; @@ -20101,7 +20614,7 @@ static PyObject *__pyx_f_7fastkde_15floodFillSearch_findNeighbors(__pyx_t_5numpy */ __pyx_t_11 = __pyx_v_test_index_right; if (__pyx_t_11 < 0) __pyx_t_11 += __pyx_v_is_not_searched.shape[0]; - __pyx_t_12 = ((*((__pyx_t_5numpy_int_t *) ( /* dim=0 */ (__pyx_v_is_not_searched.data + __pyx_t_11 * __pyx_v_is_not_searched.strides[0]) ))) == 1); + __pyx_t_12 = ((*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_is_not_searched.data + __pyx_t_11 * __pyx_v_is_not_searched.strides[0]) ))) == 1); __pyx_t_3 = __pyx_t_12; __pyx_L9_bool_binop_done:; @@ -20135,7 +20648,7 @@ static PyObject *__pyx_f_7fastkde_15floodFillSearch_findNeighbors(__pyx_t_5numpy */ __pyx_t_11 = __pyx_v_test_index_right; if (__pyx_t_11 < 0) __pyx_t_11 += __pyx_v_is_not_searched.shape[0]; - *((__pyx_t_5numpy_int_t *) ( /* dim=0 */ (__pyx_v_is_not_searched.data + __pyx_t_11 * __pyx_v_is_not_searched.strides[0]) )) = 0; + *((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_is_not_searched.data + __pyx_t_11 * __pyx_v_is_not_searched.strides[0]) )) = 0; /* "fastkde/floodFillSearch.pyx":124 * if(test_index_right >= 0): @@ -20225,7 +20738,7 @@ static PyObject *__pyx_f_7fastkde_15floodFillSearch_findNeighbors(__pyx_t_5numpy */ __pyx_t_10 = __pyx_v_test_index_left; if (__pyx_t_10 < 0) __pyx_t_10 += __pyx_v_is_not_searched.shape[0]; - __pyx_t_12 = ((*((__pyx_t_5numpy_int_t *) ( /* dim=0 */ (__pyx_v_is_not_searched.data + __pyx_t_10 * __pyx_v_is_not_searched.strides[0]) ))) == 1); + __pyx_t_12 = ((*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_is_not_searched.data + __pyx_t_10 * __pyx_v_is_not_searched.strides[0]) ))) == 1); __pyx_t_3 = __pyx_t_12; __pyx_L13_bool_binop_done:; @@ -20259,7 +20772,7 @@ static PyObject *__pyx_f_7fastkde_15floodFillSearch_findNeighbors(__pyx_t_5numpy */ __pyx_t_10 = __pyx_v_test_index_left; if (__pyx_t_10 < 0) __pyx_t_10 += __pyx_v_is_not_searched.shape[0]; - *((__pyx_t_5numpy_int_t *) ( /* dim=0 */ (__pyx_v_is_not_searched.data + __pyx_t_10 * __pyx_v_is_not_searched.strides[0]) )) = 0; + *((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_is_not_searched.data + __pyx_t_10 * __pyx_v_is_not_searched.strides[0]) )) = 0; /* "fastkde/floodFillSearch.pyx":145 * if(test_index_left > 0): @@ -20408,23 +20921,23 @@ static PyObject *__pyx_f_7fastkde_15floodFillSearch_flood_fill_search(PyArrayObj PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; - int __pyx_t_8; + unsigned int __pyx_t_8; PyObject *__pyx_t_9 = NULL; PyArrayObject *__pyx_t_10 = NULL; - PyObject *__pyx_t_11 = NULL; + int __pyx_t_11; PyObject *__pyx_t_12 = NULL; PyObject *__pyx_t_13 = NULL; - Py_ssize_t __pyx_t_14; - __pyx_t_5numpy_int64_t __pyx_t_15; - PyObject *__pyx_t_16 = NULL; - int __pyx_t_17; - __Pyx_memviewslice __pyx_t_18 = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyObject *__pyx_t_14 = NULL; + Py_ssize_t __pyx_t_15; + __pyx_t_5numpy_int64_t __pyx_t_16; + PyObject *__pyx_t_17 = NULL; + int __pyx_t_18; __Pyx_memviewslice __pyx_t_19 = { 0, 0, { 0 }, { 0 }, { 0 } }; - __pyx_t_5numpy_int64_t __pyx_t_20; + __Pyx_memviewslice __pyx_t_20 = { 0, 0, { 0 }, { 0 }, { 0 } }; __pyx_t_5numpy_int64_t __pyx_t_21; __pyx_t_5numpy_int64_t __pyx_t_22; - int __pyx_t_23; - __Pyx_memviewslice __pyx_t_24 = { 0, 0, { 0 }, { 0 }, { 0 } }; + __pyx_t_5numpy_int64_t __pyx_t_23; + int __pyx_t_24; int __pyx_t_25; int __pyx_lineno = 0; const char *__pyx_filename = NULL; @@ -20522,19 +21035,19 @@ static PyObject *__pyx_f_7fastkde_15floodFillSearch_flood_fill_search(PyArrayObj { __Pyx_BufFmt_StackElem __pyx_stack[1]; __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_array_shape.rcbuffer->pybuffer); - __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_array_shape.rcbuffer->pybuffer, (PyObject*)__pyx_t_10, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); - if (unlikely(__pyx_t_8 < 0)) { - PyErr_Fetch(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13); + __pyx_t_11 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_array_shape.rcbuffer->pybuffer, (PyObject*)__pyx_t_10, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_11 < 0)) { + PyErr_Fetch(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14); if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_array_shape.rcbuffer->pybuffer, (PyObject*)__pyx_v_array_shape, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { - Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_13); + Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_13); Py_XDECREF(__pyx_t_14); __Pyx_RaiseBufferFallbackError(); } else { - PyErr_Restore(__pyx_t_11, __pyx_t_12, __pyx_t_13); + PyErr_Restore(__pyx_t_12, __pyx_t_13, __pyx_t_14); } - __pyx_t_11 = __pyx_t_12 = __pyx_t_13 = 0; + __pyx_t_12 = __pyx_t_13 = __pyx_t_14 = 0; } __pyx_pybuffernd_array_shape.diminfo[0].strides = __pyx_pybuffernd_array_shape.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_array_shape.diminfo[0].shape = __pyx_pybuffernd_array_shape.rcbuffer->pybuffer.shape[0]; - if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 202, __pyx_L3_error) + if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 202, __pyx_L3_error) } __pyx_t_10 = 0; __pyx_v_array_shape = ((PyArrayObject *)__pyx_t_9); @@ -20547,8 +21060,8 @@ static PyObject *__pyx_f_7fastkde_15floodFillSearch_flood_fill_search(PyArrayObj * num_array_elements = np.prod(array_shape) * except BaseException as e: */ - __pyx_t_14 = PyObject_Length(((PyObject *)__pyx_v_array_shape)); if (unlikely(__pyx_t_14 == ((Py_ssize_t)-1))) __PYX_ERR(0, 203, __pyx_L3_error) - __pyx_v_array_rank = __pyx_t_14; + __pyx_t_15 = PyObject_Length(((PyObject *)__pyx_v_array_shape)); if (unlikely(__pyx_t_15 == ((Py_ssize_t)-1))) __PYX_ERR(0, 203, __pyx_L3_error) + __pyx_v_array_rank = __pyx_t_15; /* "fastkde/floodFillSearch.pyx":204 * array_shape = np.array(np.shape(input_array),dtype=np.int64) @@ -20584,9 +21097,9 @@ static PyObject *__pyx_f_7fastkde_15floodFillSearch_flood_fill_search(PyArrayObj __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } - __pyx_t_15 = __Pyx_PyInt_As_npy_int64(__pyx_t_9); if (unlikely((__pyx_t_15 == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 204, __pyx_L3_error) + __pyx_t_16 = __Pyx_PyInt_As_npy_int64(__pyx_t_9); if (unlikely((__pyx_t_16 == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 204, __pyx_L3_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_v_num_array_elements = __pyx_t_15; + __pyx_v_num_array_elements = __pyx_t_16; /* "fastkde/floodFillSearch.pyx":201 * @@ -20614,8 +21127,8 @@ static PyObject *__pyx_f_7fastkde_15floodFillSearch_flood_fill_search(PyArrayObj * raise ValueError("input_array does not appear to be array like. Error was: {}".format(e)) * */ - __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_BaseException); - if (__pyx_t_8) { + __pyx_t_11 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_BaseException); + if (__pyx_t_11) { __Pyx_AddTraceback("fastkde.floodFillSearch.flood_fill_search", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_7, &__pyx_t_4) < 0) __PYX_ERR(0, 205, __pyx_L5_except_error) __Pyx_XGOTREF(__pyx_t_9); @@ -20633,14 +21146,14 @@ static PyObject *__pyx_f_7fastkde_15floodFillSearch_flood_fill_search(PyArrayObj */ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_input_array_does_not_appear_to_b, __pyx_n_s_format); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 206, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_16 = NULL; + __pyx_t_17 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_6))) { - __pyx_t_16 = PyMethod_GET_SELF(__pyx_t_6); - if (likely(__pyx_t_16)) { + __pyx_t_17 = PyMethod_GET_SELF(__pyx_t_6); + if (likely(__pyx_t_17)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); - __Pyx_INCREF(__pyx_t_16); + __Pyx_INCREF(__pyx_t_17); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_8 = 1; @@ -20648,9 +21161,9 @@ static PyObject *__pyx_f_7fastkde_15floodFillSearch_flood_fill_search(PyArrayObj } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_16, __pyx_v_e}; + PyObject *__pyx_callargs[2] = {__pyx_t_17, __pyx_v_e}; __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); - __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; + __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 206, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; @@ -20706,8 +21219,8 @@ static PyObject *__pyx_f_7fastkde_15floodFillSearch_flood_fill_search(PyArrayObj * try: * dimension_wraps[list(wrap_dimensions)] = True */ - __pyx_t_17 = (__pyx_v_wrap_dimensions != Py_None); - if (__pyx_t_17) { + __pyx_t_18 = (__pyx_v_wrap_dimensions != Py_None); + if (__pyx_t_18) { /* "fastkde/floodFillSearch.pyx":211 * dimension_wraps = array_rank*[False] @@ -20754,7 +21267,7 @@ static PyObject *__pyx_f_7fastkde_15floodFillSearch_flood_fill_search(PyArrayObj __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L17_try_end; __pyx_L12_error:; - __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; + __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; @@ -20768,8 +21281,8 @@ static PyObject *__pyx_f_7fastkde_15floodFillSearch_flood_fill_search(PyArrayObj * raise ValueError("wrap_dimensions must be a list of valid dimensions for input_array. Original error was: {}".format(e)) * */ - __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_BaseException); - if (__pyx_t_8) { + __pyx_t_11 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_BaseException); + if (__pyx_t_11) { __Pyx_AddTraceback("fastkde.floodFillSearch.flood_fill_search", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_7, &__pyx_t_9) < 0) __PYX_ERR(0, 213, __pyx_L14_except_error) __Pyx_XGOTREF(__pyx_t_4); @@ -20787,14 +21300,14 @@ static PyObject *__pyx_f_7fastkde_15floodFillSearch_flood_fill_search(PyArrayObj */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_wrap_dimensions_must_be_a_list_o, __pyx_n_s_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 214, __pyx_L14_except_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_16 = NULL; + __pyx_t_17 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_5))) { - __pyx_t_16 = PyMethod_GET_SELF(__pyx_t_5); - if (likely(__pyx_t_16)) { + __pyx_t_17 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_17)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); - __Pyx_INCREF(__pyx_t_16); + __Pyx_INCREF(__pyx_t_17); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_8 = 1; @@ -20802,9 +21315,9 @@ static PyObject *__pyx_f_7fastkde_15floodFillSearch_flood_fill_search(PyArrayObj } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_16, __pyx_v_e}; + PyObject *__pyx_callargs[2] = {__pyx_t_17, __pyx_v_e}; __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); - __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; + __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 214, __pyx_L14_except_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; @@ -20877,7 +21390,7 @@ static PyObject *__pyx_f_7fastkde_15floodFillSearch_flood_fill_search(PyArrayObj * #Set the raveled input array * cdef np.float_t [:] raveledInputArray = input_array.ravel() # <<<<<<<<<<<<<< * #And ravel the search inidcator array - * cdef np.int_t [:] raveledIsNotSearched = is_not_searched.ravel() + * cdef np.int64_t [:] raveledIsNotSearched = is_not_searched.ravel() */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_input_array), __pyx_n_s_ravel); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 221, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); @@ -20903,16 +21416,16 @@ static PyObject *__pyx_f_7fastkde_15floodFillSearch_flood_fill_search(PyArrayObj __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } - __pyx_t_18 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float_t(__pyx_t_5, PyBUF_WRITABLE); if (unlikely(!__pyx_t_18.memview)) __PYX_ERR(0, 221, __pyx_L1_error) + __pyx_t_19 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float_t(__pyx_t_5, PyBUF_WRITABLE); if (unlikely(!__pyx_t_19.memview)) __PYX_ERR(0, 221, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_v_raveledInputArray = __pyx_t_18; - __pyx_t_18.memview = NULL; - __pyx_t_18.data = NULL; + __pyx_v_raveledInputArray = __pyx_t_19; + __pyx_t_19.memview = NULL; + __pyx_t_19.data = NULL; /* "fastkde/floodFillSearch.pyx":223 * cdef np.float_t [:] raveledInputArray = input_array.ravel() * #And ravel the search inidcator array - * cdef np.int_t [:] raveledIsNotSearched = is_not_searched.ravel() # <<<<<<<<<<<<<< + * cdef np.int64_t [:] raveledIsNotSearched = is_not_searched.ravel() # <<<<<<<<<<<<<< * * #Set the search list to null */ @@ -20940,11 +21453,11 @@ static PyObject *__pyx_f_7fastkde_15floodFillSearch_flood_fill_search(PyArrayObj __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } - __pyx_t_19 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int_t(__pyx_t_5, PyBUF_WRITABLE); if (unlikely(!__pyx_t_19.memview)) __PYX_ERR(0, 223, __pyx_L1_error) + __pyx_t_20 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(__pyx_t_5, PyBUF_WRITABLE); if (unlikely(!__pyx_t_20.memview)) __PYX_ERR(0, 223, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_v_raveledIsNotSearched = __pyx_t_19; - __pyx_t_19.memview = NULL; - __pyx_t_19.data = NULL; + __pyx_v_raveledIsNotSearched = __pyx_t_20; + __pyx_t_20.memview = NULL; + __pyx_t_20.data = NULL; /* "fastkde/floodFillSearch.pyx":226 * @@ -20965,10 +21478,10 @@ static PyObject *__pyx_f_7fastkde_15floodFillSearch_flood_fill_search(PyArrayObj * #print "{}/{}".format(i,num_array_elements) * #Check if the current element meets the search condition */ - __pyx_t_15 = __pyx_v_num_array_elements; - __pyx_t_20 = __pyx_t_15; - for (__pyx_t_21 = 0; __pyx_t_21 < __pyx_t_20; __pyx_t_21+=1) { - __pyx_v_i = __pyx_t_21; + __pyx_t_16 = __pyx_v_num_array_elements; + __pyx_t_21 = __pyx_t_16; + for (__pyx_t_22 = 0; __pyx_t_22 < __pyx_t_21; __pyx_t_22+=1) { + __pyx_v_i = __pyx_t_22; /* "fastkde/floodFillSearch.pyx":233 * #print "{}/{}".format(i,num_array_elements) @@ -20977,36 +21490,36 @@ static PyObject *__pyx_f_7fastkde_15floodFillSearch_flood_fill_search(PyArrayObj * #Flag that this cell has been searched * raveledIsNotSearched[i] = 0 */ - __pyx_t_22 = __pyx_v_i; - __pyx_t_8 = -1; - if (__pyx_t_22 < 0) { - __pyx_t_22 += __pyx_v_raveledInputArray.shape[0]; - if (unlikely(__pyx_t_22 < 0)) __pyx_t_8 = 0; - } else if (unlikely(__pyx_t_22 >= __pyx_v_raveledInputArray.shape[0])) __pyx_t_8 = 0; - if (unlikely(__pyx_t_8 != -1)) { - __Pyx_RaiseBufferIndexError(__pyx_t_8); + __pyx_t_23 = __pyx_v_i; + __pyx_t_11 = -1; + if (__pyx_t_23 < 0) { + __pyx_t_23 += __pyx_v_raveledInputArray.shape[0]; + if (unlikely(__pyx_t_23 < 0)) __pyx_t_11 = 0; + } else if (unlikely(__pyx_t_23 >= __pyx_v_raveledInputArray.shape[0])) __pyx_t_11 = 0; + if (unlikely(__pyx_t_11 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_11); __PYX_ERR(0, 233, __pyx_L1_error) } - __pyx_t_23 = ((*((__pyx_t_5numpy_float_t *) ( /* dim=0 */ (__pyx_v_raveledInputArray.data + __pyx_t_22 * __pyx_v_raveledInputArray.strides[0]) ))) >= __pyx_v_search_threshold); - if (__pyx_t_23) { + __pyx_t_24 = ((*((__pyx_t_5numpy_float_t *) ( /* dim=0 */ (__pyx_v_raveledInputArray.data + __pyx_t_23 * __pyx_v_raveledInputArray.strides[0]) ))) >= __pyx_v_search_threshold); + if (__pyx_t_24) { } else { - __pyx_t_17 = __pyx_t_23; + __pyx_t_18 = __pyx_t_24; goto __pyx_L23_bool_binop_done; } - __pyx_t_22 = __pyx_v_i; - __pyx_t_8 = -1; - if (__pyx_t_22 < 0) { - __pyx_t_22 += __pyx_v_raveledIsNotSearched.shape[0]; - if (unlikely(__pyx_t_22 < 0)) __pyx_t_8 = 0; - } else if (unlikely(__pyx_t_22 >= __pyx_v_raveledIsNotSearched.shape[0])) __pyx_t_8 = 0; - if (unlikely(__pyx_t_8 != -1)) { - __Pyx_RaiseBufferIndexError(__pyx_t_8); + __pyx_t_23 = __pyx_v_i; + __pyx_t_11 = -1; + if (__pyx_t_23 < 0) { + __pyx_t_23 += __pyx_v_raveledIsNotSearched.shape[0]; + if (unlikely(__pyx_t_23 < 0)) __pyx_t_11 = 0; + } else if (unlikely(__pyx_t_23 >= __pyx_v_raveledIsNotSearched.shape[0])) __pyx_t_11 = 0; + if (unlikely(__pyx_t_11 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_11); __PYX_ERR(0, 233, __pyx_L1_error) } - __pyx_t_23 = ((*((__pyx_t_5numpy_int_t *) ( /* dim=0 */ (__pyx_v_raveledIsNotSearched.data + __pyx_t_22 * __pyx_v_raveledIsNotSearched.strides[0]) ))) != 0); - __pyx_t_17 = __pyx_t_23; + __pyx_t_24 = ((*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_raveledIsNotSearched.data + __pyx_t_23 * __pyx_v_raveledIsNotSearched.strides[0]) ))) != 0); + __pyx_t_18 = __pyx_t_24; __pyx_L23_bool_binop_done:; - if (__pyx_t_17) { + if (__pyx_t_18) { /* "fastkde/floodFillSearch.pyx":235 * if raveledInputArray[i] >= search_threshold and raveledIsNotSearched[i]: @@ -21015,17 +21528,17 @@ static PyObject *__pyx_f_7fastkde_15floodFillSearch_flood_fill_search(PyArrayObj * * #If it does, use a flood fill search to find the contiguous area surrouinding */ - __pyx_t_22 = __pyx_v_i; - __pyx_t_8 = -1; - if (__pyx_t_22 < 0) { - __pyx_t_22 += __pyx_v_raveledIsNotSearched.shape[0]; - if (unlikely(__pyx_t_22 < 0)) __pyx_t_8 = 0; - } else if (unlikely(__pyx_t_22 >= __pyx_v_raveledIsNotSearched.shape[0])) __pyx_t_8 = 0; - if (unlikely(__pyx_t_8 != -1)) { - __Pyx_RaiseBufferIndexError(__pyx_t_8); + __pyx_t_23 = __pyx_v_i; + __pyx_t_11 = -1; + if (__pyx_t_23 < 0) { + __pyx_t_23 += __pyx_v_raveledIsNotSearched.shape[0]; + if (unlikely(__pyx_t_23 < 0)) __pyx_t_11 = 0; + } else if (unlikely(__pyx_t_23 >= __pyx_v_raveledIsNotSearched.shape[0])) __pyx_t_11 = 0; + if (unlikely(__pyx_t_11 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_11); __PYX_ERR(0, 235, __pyx_L1_error) } - *((__pyx_t_5numpy_int_t *) ( /* dim=0 */ (__pyx_v_raveledIsNotSearched.data + __pyx_t_22 * __pyx_v_raveledIsNotSearched.strides[0]) )) = 0; + *((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_raveledIsNotSearched.data + __pyx_t_23 * __pyx_v_raveledIsNotSearched.strides[0]) )) = 0; /* "fastkde/floodFillSearch.pyx":243 * findNeighbors( i, \ @@ -21034,7 +21547,7 @@ static PyObject *__pyx_f_7fastkde_15floodFillSearch_flood_fill_search(PyArrayObj * array_rank, \ * dimension_wraps, \ */ - __pyx_t_24 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(((PyObject *)__pyx_v_array_shape), PyBUF_WRITABLE); if (unlikely(!__pyx_t_24.memview)) __PYX_ERR(0, 243, __pyx_L1_error) + __pyx_t_20 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(((PyObject *)__pyx_v_array_shape), PyBUF_WRITABLE); if (unlikely(!__pyx_t_20.memview)) __PYX_ERR(0, 243, __pyx_L1_error) /* "fastkde/floodFillSearch.pyx":241 * #of this element is appended to contiguous_areas @@ -21043,10 +21556,10 @@ static PyObject *__pyx_f_7fastkde_15floodFillSearch_flood_fill_search(PyArrayObj * search_threshold, \ * array_shape, \ */ - __pyx_t_5 = __pyx_f_7fastkde_15floodFillSearch_findNeighbors(__pyx_v_i, __pyx_v_search_threshold, __pyx_t_24, __pyx_v_array_rank, __pyx_v_dimension_wraps, __pyx_v_raveledInputArray, __pyx_v_raveledIsNotSearched); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 241, __pyx_L1_error) + __pyx_t_5 = __pyx_f_7fastkde_15floodFillSearch_findNeighbors(__pyx_v_i, __pyx_v_search_threshold, __pyx_t_20, __pyx_v_array_rank, __pyx_v_dimension_wraps, __pyx_v_raveledInputArray, __pyx_v_raveledIsNotSearched); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __PYX_XCLEAR_MEMVIEW(&__pyx_t_24, 1); - __pyx_t_24.memview = NULL; __pyx_t_24.data = NULL; + __PYX_XCLEAR_MEMVIEW(&__pyx_t_20, 1); + __pyx_t_20.memview = NULL; __pyx_t_20.data = NULL; /* "fastkde/floodFillSearch.pyx":240 * #the element for which the search condition is satisified. At very least, the index @@ -21076,17 +21589,17 @@ static PyObject *__pyx_f_7fastkde_15floodFillSearch_flood_fill_search(PyArrayObj * */ /*else*/ { - __pyx_t_22 = __pyx_v_i; - __pyx_t_8 = -1; - if (__pyx_t_22 < 0) { - __pyx_t_22 += __pyx_v_raveledIsNotSearched.shape[0]; - if (unlikely(__pyx_t_22 < 0)) __pyx_t_8 = 0; - } else if (unlikely(__pyx_t_22 >= __pyx_v_raveledIsNotSearched.shape[0])) __pyx_t_8 = 0; - if (unlikely(__pyx_t_8 != -1)) { - __Pyx_RaiseBufferIndexError(__pyx_t_8); + __pyx_t_23 = __pyx_v_i; + __pyx_t_11 = -1; + if (__pyx_t_23 < 0) { + __pyx_t_23 += __pyx_v_raveledIsNotSearched.shape[0]; + if (unlikely(__pyx_t_23 < 0)) __pyx_t_11 = 0; + } else if (unlikely(__pyx_t_23 >= __pyx_v_raveledIsNotSearched.shape[0])) __pyx_t_11 = 0; + if (unlikely(__pyx_t_11 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_11); __PYX_ERR(0, 251, __pyx_L1_error) } - *((__pyx_t_5numpy_int_t *) ( /* dim=0 */ (__pyx_v_raveledIsNotSearched.data + __pyx_t_22 * __pyx_v_raveledIsNotSearched.strides[0]) )) = 0; + *((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_raveledIsNotSearched.data + __pyx_t_23 * __pyx_v_raveledIsNotSearched.strides[0]) )) = 0; } __pyx_L22:; } @@ -21118,10 +21631,9 @@ static PyObject *__pyx_f_7fastkde_15floodFillSearch_flood_fill_search(PyArrayObj __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_9); - __Pyx_XDECREF(__pyx_t_16); - __PYX_XCLEAR_MEMVIEW(&__pyx_t_18, 1); + __Pyx_XDECREF(__pyx_t_17); __PYX_XCLEAR_MEMVIEW(&__pyx_t_19, 1); - __PYX_XCLEAR_MEMVIEW(&__pyx_t_24, 1); + __PYX_XCLEAR_MEMVIEW(&__pyx_t_20, 1); { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign @@ -21702,7 +22214,7 @@ static PyObject *__pyx_pf_7fastkde_15floodFillSearch_2sort_by_distance_from_cent PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; - int __pyx_t_6; + unsigned int __pyx_t_6; Py_ssize_t __pyx_t_7; PyObject *(*__pyx_t_8)(PyObject *); PyObject *__pyx_t_9 = NULL; @@ -22199,8 +22711,10 @@ static PyObject *__pyx_pf_7fastkde_15floodFillSearch_2sort_by_distance_from_cent return __pyx_r; } +#if CYTHON_USE_FREELISTS static struct __pyx_obj_7fastkde_15floodFillSearch___pyx_scope_struct__genexpr *__pyx_freelist_7fastkde_15floodFillSearch___pyx_scope_struct__genexpr[8]; static int __pyx_freecount_7fastkde_15floodFillSearch___pyx_scope_struct__genexpr = 0; +#endif static PyObject *__pyx_tp_new_7fastkde_15floodFillSearch___pyx_scope_struct__genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; @@ -22208,7 +22722,7 @@ static PyObject *__pyx_tp_new_7fastkde_15floodFillSearch___pyx_scope_struct__gen allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); o = alloc_func(t, 0); #else - #if CYTHON_COMPILING_IN_CPYTHON + #if CYTHON_USE_FREELISTS if (likely((int)(__pyx_freecount_7fastkde_15floodFillSearch___pyx_scope_struct__genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_7fastkde_15floodFillSearch___pyx_scope_struct__genexpr)))) { o = (PyObject*)__pyx_freelist_7fastkde_15floodFillSearch___pyx_scope_struct__genexpr[--__pyx_freecount_7fastkde_15floodFillSearch___pyx_scope_struct__genexpr]; memset(o, 0, sizeof(struct __pyx_obj_7fastkde_15floodFillSearch___pyx_scope_struct__genexpr)); @@ -22238,7 +22752,7 @@ static void __pyx_tp_dealloc_7fastkde_15floodFillSearch___pyx_scope_struct__gene Py_CLEAR(p->__pyx_v_aind); Py_CLEAR(p->__pyx_v_cind); Py_CLEAR(p->__pyx_t_0); - #if CYTHON_COMPILING_IN_CPYTHON + #if CYTHON_USE_FREELISTS if (((int)(__pyx_freecount_7fastkde_15floodFillSearch___pyx_scope_struct__genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7fastkde_15floodFillSearch___pyx_scope_struct__genexpr)))) { __pyx_freelist_7fastkde_15floodFillSearch___pyx_scope_struct__genexpr[__pyx_freecount_7fastkde_15floodFillSearch___pyx_scope_struct__genexpr++] = ((struct __pyx_obj_7fastkde_15floodFillSearch___pyx_scope_struct__genexpr *)o); } else @@ -22364,6 +22878,9 @@ static PyTypeObject __pyx_type_7fastkde_15floodFillSearch___pyx_scope_struct__ge #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif + #if PY_VERSION_HEX >= 0x030d00A4 + 0, /*tp_versions_used*/ + #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif @@ -22627,6 +23144,9 @@ static PyTypeObject __pyx_type___pyx_array = { #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif + #if PY_VERSION_HEX >= 0x030d00A4 + 0, /*tp_versions_used*/ + #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif @@ -22797,6 +23317,9 @@ static PyTypeObject __pyx_type___pyx_MemviewEnum = { #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif + #if PY_VERSION_HEX >= 0x030d00A4 + 0, /*tp_versions_used*/ + #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif @@ -23140,6 +23663,9 @@ static PyTypeObject __pyx_type___pyx_memoryview = { #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif + #if PY_VERSION_HEX >= 0x030d00A4 + 0, /*tp_versions_used*/ + #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif @@ -23310,6 +23836,9 @@ static PyTypeObject __pyx_type___pyx_memoryviewslice = { #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif + #if PY_VERSION_HEX >= 0x030d00A4 + 0, /*tp_versions_used*/ + #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif @@ -23406,7 +23935,6 @@ static int __Pyx_CreateStringTabAndInitStrings(void) { {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1}, {&__pyx_n_s_fastkde_floodFillSearch, __pyx_k_fastkde_floodFillSearch, sizeof(__pyx_k_fastkde_floodFillSearch), 0, 0, 1, 1}, {&__pyx_n_s_flags, __pyx_k_flags, sizeof(__pyx_k_flags), 0, 0, 1, 1}, - {&__pyx_kp_s_floodFillSearch_pyx, __pyx_k_floodFillSearch_pyx, sizeof(__pyx_k_floodFillSearch_pyx), 0, 0, 1, 0}, {&__pyx_n_s_flood_fill_search, __pyx_k_flood_fill_search, sizeof(__pyx_k_flood_fill_search), 0, 0, 1, 1}, {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1}, {&__pyx_n_s_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 0, 1, 1}, @@ -23443,8 +23971,8 @@ static int __Pyx_CreateStringTabAndInitStrings(void) { {&__pyx_kp_s_no_default___reduce___due_to_non, __pyx_k_no_default___reduce___due_to_non, sizeof(__pyx_k_no_default___reduce___due_to_non), 0, 0, 1, 0}, {&__pyx_n_s_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1}, {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1}, - {&__pyx_kp_s_numpy_core_multiarray_failed_to, __pyx_k_numpy_core_multiarray_failed_to, sizeof(__pyx_k_numpy_core_multiarray_failed_to), 0, 0, 1, 0}, - {&__pyx_kp_s_numpy_core_umath_failed_to_impor, __pyx_k_numpy_core_umath_failed_to_impor, sizeof(__pyx_k_numpy_core_umath_failed_to_impor), 0, 0, 1, 0}, + {&__pyx_kp_s_numpy__core_multiarray_failed_to, __pyx_k_numpy__core_multiarray_failed_to, sizeof(__pyx_k_numpy__core_multiarray_failed_to), 0, 0, 1, 0}, + {&__pyx_kp_s_numpy__core_umath_failed_to_impo, __pyx_k_numpy__core_umath_failed_to_impo, sizeof(__pyx_k_numpy__core_umath_failed_to_impo), 0, 0, 1, 0}, {&__pyx_n_s_obj, __pyx_k_obj, sizeof(__pyx_k_obj), 0, 0, 1, 1}, {&__pyx_n_s_ones, __pyx_k_ones, sizeof(__pyx_k_ones), 0, 0, 1, 1}, {&__pyx_n_s_pack, __pyx_k_pack, sizeof(__pyx_k_pack), 0, 0, 1, 1}, @@ -23474,6 +24002,7 @@ static int __Pyx_CreateStringTabAndInitStrings(void) { {&__pyx_n_s_sort_by_distance_from_center_loc, __pyx_k_sort_by_distance_from_center_loc, sizeof(__pyx_k_sort_by_distance_from_center_loc), 0, 0, 1, 1}, {&__pyx_n_s_spec, __pyx_k_spec, sizeof(__pyx_k_spec), 0, 0, 1, 1}, {&__pyx_n_s_sqrt, __pyx_k_sqrt, sizeof(__pyx_k_sqrt), 0, 0, 1, 1}, + {&__pyx_kp_s_src_fastkde_floodFillSearch_pyx, __pyx_k_src_fastkde_floodFillSearch_pyx, sizeof(__pyx_k_src_fastkde_floodFillSearch_pyx), 0, 0, 1, 0}, {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1}, {&__pyx_n_s_step, __pyx_k_step, sizeof(__pyx_k_step), 0, 0, 1, 1}, {&__pyx_n_s_stop, __pyx_k_stop, sizeof(__pyx_k_stop), 0, 0, 1, 1}, @@ -23515,7 +24044,7 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis); if (!__pyx_builtin_Ellipsis) __PYX_ERR(1, 408, __pyx_L1_error) __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(1, 618, __pyx_L1_error) __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(1, 914, __pyx_L1_error) - __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(2, 983, __pyx_L1_error) + __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(2, 1025, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; @@ -23562,25 +24091,25 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__8); __Pyx_GIVEREF(__pyx_tuple__8); - /* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":983 + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1025 * __pyx_import_array() * except Exception: - * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<< + * raise ImportError("numpy._core.multiarray failed to import") # <<<<<<<<<<<<<< * * cdef inline int import_umath() except -1: */ - __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(2, 983, __pyx_L1_error) + __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_s_numpy__core_multiarray_failed_to); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(2, 1025, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__9); __Pyx_GIVEREF(__pyx_tuple__9); - /* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":989 + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1031 * _import_umath() * except Exception: - * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< + * raise ImportError("numpy._core.umath failed to import") # <<<<<<<<<<<<<< * * cdef inline int import_ufunc() except -1: */ - __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(2, 989, __pyx_L1_error) + __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_numpy__core_umath_failed_to_impo); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(2, 1031, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__10); __Pyx_GIVEREF(__pyx_tuple__10); @@ -23695,7 +24224,7 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __pyx_tuple__22 = PyTuple_Pack(3, __pyx_n_s_input_array, __pyx_n_s_search_threshold, __pyx_n_s_wrap_dimensions); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(0, 163, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__22); __Pyx_GIVEREF(__pyx_tuple__22); - __pyx_codeobj__23 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__22, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_floodFillSearch_pyx, __pyx_n_s_flood_fill_search, 163, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__23)) __PYX_ERR(0, 163, __pyx_L1_error) + __pyx_codeobj__23 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__22, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_fastkde_floodFillSearch_pyx, __pyx_n_s_flood_fill_search, 163, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__23)) __PYX_ERR(0, 163, __pyx_L1_error) __pyx_tuple__24 = PyTuple_Pack(2, __pyx_float_0_0, Py_None); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(0, 163, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__24); __Pyx_GIVEREF(__pyx_tuple__24); @@ -23710,7 +24239,7 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __pyx_tuple__25 = PyTuple_Pack(13, __pyx_n_s_inds, __pyx_n_s_var_shape, __pyx_n_s_center, __pyx_n_s_centeredInds, __pyx_n_s_centersOfMass, __pyx_n_s_distances, __pyx_n_s_isort, __pyx_n_s_indTuples, __pyx_n_s_genexpr, __pyx_n_s_genexpr, __pyx_n_s_aind, __pyx_n_s_indices, __pyx_n_s_i); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(0, 258, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__25); __Pyx_GIVEREF(__pyx_tuple__25); - __pyx_codeobj__26 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 13, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__25, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_floodFillSearch_pyx, __pyx_n_s_sort_by_distance_from_center, 258, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__26)) __PYX_ERR(0, 258, __pyx_L1_error) + __pyx_codeobj__26 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 13, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__25, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_fastkde_floodFillSearch_pyx, __pyx_n_s_sort_by_distance_from_center, 258, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__26)) __PYX_ERR(0, 258, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; @@ -23990,33 +24519,33 @@ static int __Pyx_modinit_type_import_code(void) { /*--- Type import code ---*/ __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_ptype_7cpython_4type_type = __Pyx_ImportType_3_0_3(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type", + __pyx_ptype_7cpython_4type_type = __Pyx_ImportType_3_0_11(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type", #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000 - sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_3(PyTypeObject), + sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyTypeObject), #elif CYTHON_COMPILING_IN_LIMITED_API - sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_3(PyTypeObject), + sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyTypeObject), #else - sizeof(PyHeapTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_3(PyHeapTypeObject), + sizeof(PyHeapTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyHeapTypeObject), #endif - __Pyx_ImportType_CheckSize_Warn_3_0_3); if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(3, 9, __pyx_L1_error) + __Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(3, 9, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyImport_ImportModule("numpy"); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 202, __pyx_L1_error) + __pyx_t_1 = PyImport_ImportModule("numpy"); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 271, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_ptype_5numpy_dtype = __Pyx_ImportType_3_0_3(__pyx_t_1, "numpy", "dtype", sizeof(PyArray_Descr), __PYX_GET_STRUCT_ALIGNMENT_3_0_3(PyArray_Descr),__Pyx_ImportType_CheckSize_Ignore_3_0_3); if (!__pyx_ptype_5numpy_dtype) __PYX_ERR(2, 202, __pyx_L1_error) - __pyx_ptype_5numpy_flatiter = __Pyx_ImportType_3_0_3(__pyx_t_1, "numpy", "flatiter", sizeof(PyArrayIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_3(PyArrayIterObject),__Pyx_ImportType_CheckSize_Ignore_3_0_3); if (!__pyx_ptype_5numpy_flatiter) __PYX_ERR(2, 225, __pyx_L1_error) - __pyx_ptype_5numpy_broadcast = __Pyx_ImportType_3_0_3(__pyx_t_1, "numpy", "broadcast", sizeof(PyArrayMultiIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_3(PyArrayMultiIterObject),__Pyx_ImportType_CheckSize_Ignore_3_0_3); if (!__pyx_ptype_5numpy_broadcast) __PYX_ERR(2, 229, __pyx_L1_error) - __pyx_ptype_5numpy_ndarray = __Pyx_ImportType_3_0_3(__pyx_t_1, "numpy", "ndarray", sizeof(PyArrayObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_3(PyArrayObject),__Pyx_ImportType_CheckSize_Ignore_3_0_3); if (!__pyx_ptype_5numpy_ndarray) __PYX_ERR(2, 238, __pyx_L1_error) - __pyx_ptype_5numpy_generic = __Pyx_ImportType_3_0_3(__pyx_t_1, "numpy", "generic", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_3(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_3); if (!__pyx_ptype_5numpy_generic) __PYX_ERR(2, 809, __pyx_L1_error) - __pyx_ptype_5numpy_number = __Pyx_ImportType_3_0_3(__pyx_t_1, "numpy", "number", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_3(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_3); if (!__pyx_ptype_5numpy_number) __PYX_ERR(2, 811, __pyx_L1_error) - __pyx_ptype_5numpy_integer = __Pyx_ImportType_3_0_3(__pyx_t_1, "numpy", "integer", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_3(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_3); if (!__pyx_ptype_5numpy_integer) __PYX_ERR(2, 813, __pyx_L1_error) - __pyx_ptype_5numpy_signedinteger = __Pyx_ImportType_3_0_3(__pyx_t_1, "numpy", "signedinteger", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_3(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_3); if (!__pyx_ptype_5numpy_signedinteger) __PYX_ERR(2, 815, __pyx_L1_error) - __pyx_ptype_5numpy_unsignedinteger = __Pyx_ImportType_3_0_3(__pyx_t_1, "numpy", "unsignedinteger", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_3(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_3); if (!__pyx_ptype_5numpy_unsignedinteger) __PYX_ERR(2, 817, __pyx_L1_error) - __pyx_ptype_5numpy_inexact = __Pyx_ImportType_3_0_3(__pyx_t_1, "numpy", "inexact", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_3(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_3); if (!__pyx_ptype_5numpy_inexact) __PYX_ERR(2, 819, __pyx_L1_error) - __pyx_ptype_5numpy_floating = __Pyx_ImportType_3_0_3(__pyx_t_1, "numpy", "floating", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_3(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_3); if (!__pyx_ptype_5numpy_floating) __PYX_ERR(2, 821, __pyx_L1_error) - __pyx_ptype_5numpy_complexfloating = __Pyx_ImportType_3_0_3(__pyx_t_1, "numpy", "complexfloating", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_3(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_3); if (!__pyx_ptype_5numpy_complexfloating) __PYX_ERR(2, 823, __pyx_L1_error) - __pyx_ptype_5numpy_flexible = __Pyx_ImportType_3_0_3(__pyx_t_1, "numpy", "flexible", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_3(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_3); if (!__pyx_ptype_5numpy_flexible) __PYX_ERR(2, 825, __pyx_L1_error) - __pyx_ptype_5numpy_character = __Pyx_ImportType_3_0_3(__pyx_t_1, "numpy", "character", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_3(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_3); if (!__pyx_ptype_5numpy_character) __PYX_ERR(2, 827, __pyx_L1_error) - __pyx_ptype_5numpy_ufunc = __Pyx_ImportType_3_0_3(__pyx_t_1, "numpy", "ufunc", sizeof(PyUFuncObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_3(PyUFuncObject),__Pyx_ImportType_CheckSize_Ignore_3_0_3); if (!__pyx_ptype_5numpy_ufunc) __PYX_ERR(2, 865, __pyx_L1_error) + __pyx_ptype_5numpy_dtype = __Pyx_ImportType_3_0_11(__pyx_t_1, "numpy", "dtype", sizeof(PyArray_Descr), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyArray_Descr),__Pyx_ImportType_CheckSize_Ignore_3_0_11); if (!__pyx_ptype_5numpy_dtype) __PYX_ERR(2, 271, __pyx_L1_error) + __pyx_ptype_5numpy_flatiter = __Pyx_ImportType_3_0_11(__pyx_t_1, "numpy", "flatiter", sizeof(PyArrayIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyArrayIterObject),__Pyx_ImportType_CheckSize_Ignore_3_0_11); if (!__pyx_ptype_5numpy_flatiter) __PYX_ERR(2, 316, __pyx_L1_error) + __pyx_ptype_5numpy_broadcast = __Pyx_ImportType_3_0_11(__pyx_t_1, "numpy", "broadcast", sizeof(PyArrayMultiIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyArrayMultiIterObject),__Pyx_ImportType_CheckSize_Ignore_3_0_11); if (!__pyx_ptype_5numpy_broadcast) __PYX_ERR(2, 320, __pyx_L1_error) + __pyx_ptype_5numpy_ndarray = __Pyx_ImportType_3_0_11(__pyx_t_1, "numpy", "ndarray", sizeof(PyArrayObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyArrayObject),__Pyx_ImportType_CheckSize_Ignore_3_0_11); if (!__pyx_ptype_5numpy_ndarray) __PYX_ERR(2, 359, __pyx_L1_error) + __pyx_ptype_5numpy_generic = __Pyx_ImportType_3_0_11(__pyx_t_1, "numpy", "generic", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5numpy_generic) __PYX_ERR(2, 847, __pyx_L1_error) + __pyx_ptype_5numpy_number = __Pyx_ImportType_3_0_11(__pyx_t_1, "numpy", "number", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5numpy_number) __PYX_ERR(2, 849, __pyx_L1_error) + __pyx_ptype_5numpy_integer = __Pyx_ImportType_3_0_11(__pyx_t_1, "numpy", "integer", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5numpy_integer) __PYX_ERR(2, 851, __pyx_L1_error) + __pyx_ptype_5numpy_signedinteger = __Pyx_ImportType_3_0_11(__pyx_t_1, "numpy", "signedinteger", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5numpy_signedinteger) __PYX_ERR(2, 853, __pyx_L1_error) + __pyx_ptype_5numpy_unsignedinteger = __Pyx_ImportType_3_0_11(__pyx_t_1, "numpy", "unsignedinteger", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5numpy_unsignedinteger) __PYX_ERR(2, 855, __pyx_L1_error) + __pyx_ptype_5numpy_inexact = __Pyx_ImportType_3_0_11(__pyx_t_1, "numpy", "inexact", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5numpy_inexact) __PYX_ERR(2, 857, __pyx_L1_error) + __pyx_ptype_5numpy_floating = __Pyx_ImportType_3_0_11(__pyx_t_1, "numpy", "floating", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5numpy_floating) __PYX_ERR(2, 859, __pyx_L1_error) + __pyx_ptype_5numpy_complexfloating = __Pyx_ImportType_3_0_11(__pyx_t_1, "numpy", "complexfloating", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5numpy_complexfloating) __PYX_ERR(2, 861, __pyx_L1_error) + __pyx_ptype_5numpy_flexible = __Pyx_ImportType_3_0_11(__pyx_t_1, "numpy", "flexible", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5numpy_flexible) __PYX_ERR(2, 863, __pyx_L1_error) + __pyx_ptype_5numpy_character = __Pyx_ImportType_3_0_11(__pyx_t_1, "numpy", "character", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5numpy_character) __PYX_ERR(2, 865, __pyx_L1_error) + __pyx_ptype_5numpy_ufunc = __Pyx_ImportType_3_0_11(__pyx_t_1, "numpy", "ufunc", sizeof(PyUFuncObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyUFuncObject),__Pyx_ImportType_CheckSize_Ignore_3_0_11); if (!__pyx_ptype_5numpy_ufunc) __PYX_ERR(2, 929, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_RefNannyFinishContext(); return 0; @@ -24236,7 +24765,7 @@ static CYTHON_SMALL_CODE int __pyx_pymod_exec_floodFillSearch(PyObject *__pyx_py __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) { int add_module_result = PyState_AddModule(__pyx_t_1, &__pyx_moduledef); - __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to floodFillSearch pseudovariable */ + __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to "floodFillSearch" pseudovariable */ if (unlikely((add_module_result < 0))) __PYX_ERR(0, 1, __pyx_L1_error) pystate_addmodule_run = 1; } @@ -24248,10 +24777,8 @@ static CYTHON_SMALL_CODE int __pyx_pymod_exec_floodFillSearch(PyObject *__pyx_py CYTHON_UNUSED_VAR(__pyx_t_1); __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) Py_INCREF(__pyx_d); - __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) - Py_INCREF(__pyx_b); - __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) - Py_INCREF(__pyx_cython_runtime); + __pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_cython_runtime = __Pyx_PyImport_AddModuleRef((const char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #if CYTHON_REFNANNY __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); @@ -25075,14 +25602,20 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject #endif /* PyObjectGetAttrStrNoError */ +#if __PYX_LIMITED_VERSION_HEX < 0x030d00A1 static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) __Pyx_PyErr_Clear(); } +#endif static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) { PyObject *result; +#if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 + (void) PyObject_GetOptionalAttr(obj, attr_name, &result); + return result; +#else #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1 PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) { @@ -25094,6 +25627,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, P __Pyx_PyObject_GetAttrStr_ClearAttributeError(); } return result; +#endif } /* GetBuiltinName */ @@ -25309,13 +25843,31 @@ static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyO { int eq = __Pyx_PyUnicode_Equals(s, PyTuple_GET_ITEM(kwnames, i), Py_EQ); if (unlikely(eq != 0)) { - if (unlikely(eq < 0)) return NULL; // error + if (unlikely(eq < 0)) return NULL; return kwvalues[i]; } } - return NULL; // not found (no exception set) + return NULL; +} +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 +CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues) { + Py_ssize_t i, nkwargs = PyTuple_GET_SIZE(kwnames); + PyObject *dict; + dict = PyDict_New(); + if (unlikely(!dict)) + return NULL; + for (i=0; i= 3 co->co_kwonlyargcount == 0 && @@ -25825,8 +26383,13 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg ternaryfunc call = Py_TYPE(func)->tp_call; if (unlikely(!call)) return PyObject_Call(func, arg, kw); + #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; + #else + if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) + return NULL; + #endif result = (*call)(func, arg, kw); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { @@ -25845,8 +26408,13 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject PyCFunction cfunc; cfunc = __Pyx_CyOrPyCFunction_GET_FUNCTION(func); self = __Pyx_CyOrPyCFunction_GET_SELF(func); + #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; + #else + if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) + return NULL; + #endif result = cfunc(self, arg); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { @@ -25911,7 +26479,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObj #endif if (kwargs == NULL) { #if CYTHON_VECTORCALL - #if Py_VERSION_HEX < 0x03090000 + #if PY_VERSION_HEX < 0x03090000 vectorcallfunc f = _PyVectorcall_Function(func); #else vectorcallfunc f = PyVectorcall_Function(func); @@ -26236,7 +26804,7 @@ static PyObject* __Pyx_PyUnicode_Join(PyObject* value_tuple, Py_ssize_t value_co if (!CYTHON_PEP393_ENABLED || ukind == result_ukind) { memcpy((char *)result_udata + (char_pos << kind_shift), udata, (size_t) (ulength << kind_shift)); } else { - #if PY_VERSION_HEX >= 0x030D0000 + #if PY_VERSION_HEX >= 0x030d0000 if (unlikely(PyUnicode_CopyCharacters(result_uval, char_pos, uval, 0, ulength) < 0)) goto bad; #elif CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030300F0 || defined(_PyUnicode_FastCopyCharacters) _PyUnicode_FastCopyCharacters(result_uval, char_pos, uval, 0, ulength); @@ -26365,7 +26933,7 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, } } #else - if (is_list || PySequence_Check(o)) { + if (is_list || !PyMapping_Check(o)) { return PySequence_GetItem(o, i); } #endif @@ -26400,7 +26968,9 @@ static PyObject *__Pyx_PyObject_GetItem_Slow(PyObject *obj, PyObject *key) { __Pyx_TypeName obj_type_name; if (likely(PyType_Check(obj))) { PyObject *meth = __Pyx_PyObject_GetAttrStrNoError(obj, __pyx_n_s_class_getitem); - if (meth) { + if (!meth) { + PyErr_Clear(); + } else { PyObject *result = __Pyx_PyObject_CallOneArg(meth, key); Py_DECREF(meth); return result; @@ -26509,6 +27079,7 @@ static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t a, Py_ssize_t b) } /* GetAttr3 */ +#if __PYX_LIMITED_VERSION_HEX < 0x030d00A1 static PyObject *__Pyx_GetAttr3Default(PyObject *d) { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign @@ -26518,9 +27089,14 @@ static PyObject *__Pyx_GetAttr3Default(PyObject *d) { Py_INCREF(d); return d; } +#endif static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) { PyObject *r; -#if CYTHON_USE_TYPE_SLOTS +#if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 + int res = PyObject_GetOptionalAttr(o, n, &r); + return (res != 0) ? r : __Pyx_NewRef(d); +#else + #if CYTHON_USE_TYPE_SLOTS if (likely(PyString_Check(n))) { r = __Pyx_PyObject_GetAttrStrNoError(o, n); if (unlikely(!r) && likely(!PyErr_Occurred())) { @@ -26528,9 +27104,10 @@ static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject } return r; } -#endif + #endif r = PyObject_GetAttr(o, n); return (likely(r)) ? r : __Pyx_GetAttr3Default(d); +#endif } /* PyDictVersioning */ @@ -26568,7 +27145,7 @@ static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) { PyObject *result; #if !CYTHON_AVOID_BORROWED_REFS -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && PY_VERSION_HEX < 0x030d0000 result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { @@ -27240,11 +27817,7 @@ static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObje } } #else -#if CYTHON_COMPILING_IN_PYPY - if (is_list || (PySequence_Check(o) && !PyDict_Check(o))) -#else - if (is_list || PySequence_Check(o)) -#endif + if (is_list || !PyMapping_Check(o)) { return PySequence_SetItem(o, i, v); } @@ -27440,12 +28013,21 @@ static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **me } /* PyObjectCallMethod1 */ +#if !(CYTHON_VECTORCALL && __PYX_LIMITED_VERSION_HEX >= 0x030C00A2) static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg) { PyObject *result = __Pyx_PyObject_CallOneArg(method, arg); Py_DECREF(method); return result; } +#endif static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) { +#if CYTHON_VECTORCALL && __PYX_LIMITED_VERSION_HEX >= 0x030C00A2 + PyObject *args[2] = {obj, arg}; + (void) __Pyx_PyObject_GetMethod; + (void) __Pyx_PyObject_CallOneArg; + (void) __Pyx_PyObject_Call2Args; + return PyObject_VectorcallMethod(method_name, args, 2 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL); +#else PyObject *method = NULL, *result; int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method); if (likely(is_method)) { @@ -27455,6 +28037,7 @@ static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name } if (unlikely(!method)) return NULL; return __Pyx__PyObject_CallMethod1(method, arg); +#endif } /* pop_index */ @@ -28068,9 +28651,10 @@ fail:; /* IterFinish */ static CYTHON_INLINE int __Pyx_IterFinish(void) { + PyObject* exc_type; __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign - PyObject* exc_type = __Pyx_PyErr_CurrentExceptionType(); + exc_type = __Pyx_PyErr_CurrentExceptionType(); if (unlikely(exc_type)) { if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) return -1; @@ -28282,38 +28866,38 @@ static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffs #endif return -1; } -#if !CYTHON_USE_TYPE_SLOTS - if (dictoffset == 0) { - PyErr_Format(PyExc_TypeError, - "extension type '%s.200s': " - "unable to validate whether bases have a __dict__ " - "when CYTHON_USE_TYPE_SLOTS is off " - "(likely because you are building in the limited API). " - "Therefore, all extension types with multiple bases " - "must add 'cdef dict __dict__' in this compilation mode", - type_name); -#if CYTHON_AVOID_BORROWED_REFS - Py_DECREF(b0); -#endif - return -1; - } -#else - if (dictoffset == 0 && b->tp_dictoffset) + if (dictoffset == 0) { - __Pyx_TypeName b_name = __Pyx_PyType_GetName(b); - PyErr_Format(PyExc_TypeError, - "extension type '%.200s' has no __dict__ slot, " - "but base type '" __Pyx_FMT_TYPENAME "' has: " - "either add 'cdef dict __dict__' to the extension type " - "or add '__slots__ = [...]' to the base type", - type_name, b_name); - __Pyx_DECREF_TypeName(b_name); + Py_ssize_t b_dictoffset = 0; +#if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY + b_dictoffset = b->tp_dictoffset; +#else + PyObject *py_b_dictoffset = PyObject_GetAttrString((PyObject*)b, "__dictoffset__"); + if (!py_b_dictoffset) goto dictoffset_return; + b_dictoffset = PyLong_AsSsize_t(py_b_dictoffset); + Py_DECREF(py_b_dictoffset); + if (b_dictoffset == -1 && PyErr_Occurred()) goto dictoffset_return; +#endif + if (b_dictoffset) { + { + __Pyx_TypeName b_name = __Pyx_PyType_GetName(b); + PyErr_Format(PyExc_TypeError, + "extension type '%.200s' has no __dict__ slot, " + "but base type '" __Pyx_FMT_TYPENAME "' has: " + "either add 'cdef dict __dict__' to the extension type " + "or add '__slots__ = [...]' to the base type", + type_name, b_name); + __Pyx_DECREF_TypeName(b_name); + } +#if !(CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY) + dictoffset_return: +#endif #if CYTHON_AVOID_BORROWED_REFS - Py_DECREF(b0); + Py_DECREF(b0); #endif - return -1; + return -1; + } } -#endif #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(b0); #endif @@ -28607,10 +29191,10 @@ static int __Pyx_setup_reduce(PyObject* type_obj) { #endif /* TypeImport */ - #ifndef __PYX_HAVE_RT_ImportType_3_0_3 -#define __PYX_HAVE_RT_ImportType_3_0_3 -static PyTypeObject *__Pyx_ImportType_3_0_3(PyObject *module, const char *module_name, const char *class_name, - size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_3 check_size) + #ifndef __PYX_HAVE_RT_ImportType_3_0_11 +#define __PYX_HAVE_RT_ImportType_3_0_11 +static PyTypeObject *__Pyx_ImportType_3_0_11(PyObject *module, const char *module_name, const char *class_name, + size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_11 check_size) { PyObject *result = 0; char warning[200]; @@ -28664,7 +29248,7 @@ static PyTypeObject *__Pyx_ImportType_3_0_3(PyObject *module, const char *module module_name, class_name, size, basicsize+itemsize); goto bad; } - if (check_size == __Pyx_ImportType_CheckSize_Error_3_0_3 && + if (check_size == __Pyx_ImportType_CheckSize_Error_3_0_11 && ((size_t)basicsize > size || (size_t)(basicsize + itemsize) < size)) { PyErr_Format(PyExc_ValueError, "%.200s.%.200s size changed, may indicate binary incompatibility. " @@ -28672,7 +29256,7 @@ static PyTypeObject *__Pyx_ImportType_3_0_3(PyObject *module, const char *module module_name, class_name, size, basicsize, basicsize+itemsize); goto bad; } - else if (check_size == __Pyx_ImportType_CheckSize_Warn_3_0_3 && (size_t)basicsize > size) { + else if (check_size == __Pyx_ImportType_CheckSize_Warn_3_0_11 && (size_t)basicsize > size) { PyOS_snprintf(warning, sizeof(warning), "%s.%s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd from PyObject", @@ -28716,10 +29300,7 @@ static PyTypeObject *__Pyx_ImportType_3_0_3(PyObject *module, const char *module /* FetchSharedCythonModule */ static PyObject *__Pyx_FetchSharedCythonABIModule(void) { - PyObject *abi_module = PyImport_AddModule((char*) __PYX_ABI_MODULE_NAME); - if (unlikely(!abi_module)) return NULL; - Py_INCREF(abi_module); - return abi_module; + return __Pyx_PyImport_AddModuleRef((char*) __PYX_ABI_MODULE_NAME); } /* FetchCommonType */ @@ -29703,7 +30284,7 @@ static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, default: return NULL; } - return ((_PyCFunctionFastWithKeywords)(void(*)(void))def->ml_meth)(self, args, nargs, kwnames); + return ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))def->ml_meth)(self, args, nargs, kwnames); } static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { @@ -29838,6 +30419,9 @@ static PyTypeObject __pyx_CyFunctionType_type = { #if PY_VERSION_HEX >= 0x030C0000 0, #endif +#if PY_VERSION_HEX >= 0x030d00A4 + 0, +#endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, #endif @@ -30042,8 +30626,8 @@ static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject Py_DECREF(replace); return result; } - #if __PYX_LIMITED_VERSION_HEX < 0x030780000 PyErr_Clear(); + #if __PYX_LIMITED_VERSION_HEX < 0x030780000 { PyObject *compiled = NULL, *result = NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "code", code))) return NULL; @@ -30063,6 +30647,8 @@ static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject if (result) Py_INCREF(result); return result; } + #else + return NULL; #endif } static void __Pyx_AddTraceback(const char *funcname, int c_line, @@ -30160,7 +30746,7 @@ static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( #else py_code = PyCode_NewEmpty(filename, funcname, py_line); #endif - Py_XDECREF(py_funcname); // XDECREF since it's only set on Py3 if cline + Py_XDECREF(py_funcname); return py_code; bad: Py_XDECREF(py_funcname); @@ -30574,29 +31160,6 @@ static int __Pyx_ValidateAndInit_memviewslice( return result; } -/* ObjectToMemviewSlice */ - static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int_t(PyObject *obj, int writable_flag) { - __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } }; - __Pyx_BufFmt_StackElem stack[1]; - int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) }; - int retcode; - if (obj == Py_None) { - result.memview = (struct __pyx_memoryview_obj *) Py_None; - return result; - } - retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0, - PyBUF_RECORDS_RO | writable_flag, 1, - &__Pyx_TypeInfo_nn___pyx_t_5numpy_int_t, stack, - &result, obj); - if (unlikely(retcode == -1)) - goto __pyx_fail; - return result; -__pyx_fail: - result.memview = NULL; - result.data = NULL; - return result; -} - /* ObjectToMemviewSlice */ static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(PyObject *obj, int writable_flag) { __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } }; @@ -30764,11 +31327,165 @@ static int __Pyx_ValidateAndInit_memviewslice( r = __Pyx_c_abs_float(a); theta = atan2f(a.imag, a.real); } - lnr = logf(r); - z_r = expf(lnr * b.real - theta * b.imag); + lnr = logf(r); + z_r = expf(lnr * b.real - theta * b.imag); + z_theta = theta * b.real + lnr * b.imag; + z.real = z_r * cosf(z_theta); + z.imag = z_r * sinf(z_theta); + return z; + } + #endif +#endif + +/* Declarations */ + #if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus) + #ifdef __cplusplus + static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) { + return ::std::complex< double >(x, y); + } + #else + static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) { + return x + y*(__pyx_t_double_complex)_Complex_I; + } + #endif +#else + static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) { + __pyx_t_double_complex z; + z.real = x; + z.imag = y; + return z; + } +#endif + +/* Arithmetic */ + #if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus) +#else + static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex a, __pyx_t_double_complex b) { + return (a.real == b.real) && (a.imag == b.imag); + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex a, __pyx_t_double_complex b) { + __pyx_t_double_complex z; + z.real = a.real + b.real; + z.imag = a.imag + b.imag; + return z; + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex a, __pyx_t_double_complex b) { + __pyx_t_double_complex z; + z.real = a.real - b.real; + z.imag = a.imag - b.imag; + return z; + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex a, __pyx_t_double_complex b) { + __pyx_t_double_complex z; + z.real = a.real * b.real - a.imag * b.imag; + z.imag = a.real * b.imag + a.imag * b.real; + return z; + } + #if 1 + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) { + if (b.imag == 0) { + return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real); + } else if (fabs(b.real) >= fabs(b.imag)) { + if (b.real == 0 && b.imag == 0) { + return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag); + } else { + double r = b.imag / b.real; + double s = (double)(1.0) / (b.real + b.imag * r); + return __pyx_t_double_complex_from_parts( + (a.real + a.imag * r) * s, (a.imag - a.real * r) * s); + } + } else { + double r = b.real / b.imag; + double s = (double)(1.0) / (b.imag + b.real * r); + return __pyx_t_double_complex_from_parts( + (a.real * r + a.imag) * s, (a.imag * r - a.real) * s); + } + } + #else + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) { + if (b.imag == 0) { + return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real); + } else { + double denom = b.real * b.real + b.imag * b.imag; + return __pyx_t_double_complex_from_parts( + (a.real * b.real + a.imag * b.imag) / denom, + (a.imag * b.real - a.real * b.imag) / denom); + } + } + #endif + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex a) { + __pyx_t_double_complex z; + z.real = -a.real; + z.imag = -a.imag; + return z; + } + static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex a) { + return (a.real == 0) && (a.imag == 0); + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex a) { + __pyx_t_double_complex z; + z.real = a.real; + z.imag = -a.imag; + return z; + } + #if 1 + static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex z) { + #if !defined(HAVE_HYPOT) || defined(_MSC_VER) + return sqrt(z.real*z.real + z.imag*z.imag); + #else + return hypot(z.real, z.imag); + #endif + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex a, __pyx_t_double_complex b) { + __pyx_t_double_complex z; + double r, lnr, theta, z_r, z_theta; + if (b.imag == 0 && b.real == (int)b.real) { + if (b.real < 0) { + double denom = a.real * a.real + a.imag * a.imag; + a.real = a.real / denom; + a.imag = -a.imag / denom; + b.real = -b.real; + } + switch ((int)b.real) { + case 0: + z.real = 1; + z.imag = 0; + return z; + case 1: + return a; + case 2: + return __Pyx_c_prod_double(a, a); + case 3: + z = __Pyx_c_prod_double(a, a); + return __Pyx_c_prod_double(z, a); + case 4: + z = __Pyx_c_prod_double(a, a); + return __Pyx_c_prod_double(z, z); + } + } + if (a.imag == 0) { + if (a.real == 0) { + return a; + } else if ((b.imag == 0) && (a.real >= 0)) { + z.real = pow(a.real, b.real); + z.imag = 0; + return z; + } else if (a.real > 0) { + r = a.real; + theta = 0; + } else { + r = -a.real; + theta = atan2(0.0, -1.0); + } + } else { + r = __Pyx_c_abs_double(a); + theta = atan2(a.imag, a.real); + } + lnr = log(r); + z_r = exp(lnr * b.real - theta * b.imag); z_theta = theta * b.real + lnr * b.imag; - z.real = z_r * cosf(z_theta); - z.imag = z_r * sinf(z_theta); + z.real = z_r * cos(z_theta); + z.imag = z_r * sin(z_theta); return z; } #endif @@ -30777,17 +31494,17 @@ static int __Pyx_ValidateAndInit_memviewslice( /* Declarations */ #if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus) #ifdef __cplusplus - static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) { - return ::std::complex< double >(x, y); + static CYTHON_INLINE __pyx_t_long_double_complex __pyx_t_long_double_complex_from_parts(long double x, long double y) { + return ::std::complex< long double >(x, y); } #else - static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) { - return x + y*(__pyx_t_double_complex)_Complex_I; + static CYTHON_INLINE __pyx_t_long_double_complex __pyx_t_long_double_complex_from_parts(long double x, long double y) { + return x + y*(__pyx_t_long_double_complex)_Complex_I; } #endif #else - static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) { - __pyx_t_double_complex z; + static CYTHON_INLINE __pyx_t_long_double_complex __pyx_t_long_double_complex_from_parts(long double x, long double y) { + __pyx_t_long_double_complex z; z.real = x; z.imag = y; return z; @@ -30797,88 +31514,88 @@ static int __Pyx_ValidateAndInit_memviewslice( /* Arithmetic */ #if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus) #else - static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex a, __pyx_t_double_complex b) { + static CYTHON_INLINE int __Pyx_c_eq_long__double(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) { return (a.real == b.real) && (a.imag == b.imag); } - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex a, __pyx_t_double_complex b) { - __pyx_t_double_complex z; + static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_sum_long__double(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) { + __pyx_t_long_double_complex z; z.real = a.real + b.real; z.imag = a.imag + b.imag; return z; } - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex a, __pyx_t_double_complex b) { - __pyx_t_double_complex z; + static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_diff_long__double(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) { + __pyx_t_long_double_complex z; z.real = a.real - b.real; z.imag = a.imag - b.imag; return z; } - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex a, __pyx_t_double_complex b) { - __pyx_t_double_complex z; + static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_prod_long__double(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) { + __pyx_t_long_double_complex z; z.real = a.real * b.real - a.imag * b.imag; z.imag = a.real * b.imag + a.imag * b.real; return z; } #if 1 - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) { + static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_quot_long__double(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) { if (b.imag == 0) { - return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real); - } else if (fabs(b.real) >= fabs(b.imag)) { + return __pyx_t_long_double_complex_from_parts(a.real / b.real, a.imag / b.real); + } else if (fabsl(b.real) >= fabsl(b.imag)) { if (b.real == 0 && b.imag == 0) { - return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag); + return __pyx_t_long_double_complex_from_parts(a.real / b.real, a.imag / b.imag); } else { - double r = b.imag / b.real; - double s = (double)(1.0) / (b.real + b.imag * r); - return __pyx_t_double_complex_from_parts( + long double r = b.imag / b.real; + long double s = (long double)(1.0) / (b.real + b.imag * r); + return __pyx_t_long_double_complex_from_parts( (a.real + a.imag * r) * s, (a.imag - a.real * r) * s); } } else { - double r = b.real / b.imag; - double s = (double)(1.0) / (b.imag + b.real * r); - return __pyx_t_double_complex_from_parts( + long double r = b.real / b.imag; + long double s = (long double)(1.0) / (b.imag + b.real * r); + return __pyx_t_long_double_complex_from_parts( (a.real * r + a.imag) * s, (a.imag * r - a.real) * s); } } #else - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) { + static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_quot_long__double(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) { if (b.imag == 0) { - return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real); + return __pyx_t_long_double_complex_from_parts(a.real / b.real, a.imag / b.real); } else { - double denom = b.real * b.real + b.imag * b.imag; - return __pyx_t_double_complex_from_parts( + long double denom = b.real * b.real + b.imag * b.imag; + return __pyx_t_long_double_complex_from_parts( (a.real * b.real + a.imag * b.imag) / denom, (a.imag * b.real - a.real * b.imag) / denom); } } #endif - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex a) { - __pyx_t_double_complex z; + static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_neg_long__double(__pyx_t_long_double_complex a) { + __pyx_t_long_double_complex z; z.real = -a.real; z.imag = -a.imag; return z; } - static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex a) { + static CYTHON_INLINE int __Pyx_c_is_zero_long__double(__pyx_t_long_double_complex a) { return (a.real == 0) && (a.imag == 0); } - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex a) { - __pyx_t_double_complex z; + static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_conj_long__double(__pyx_t_long_double_complex a) { + __pyx_t_long_double_complex z; z.real = a.real; z.imag = -a.imag; return z; } #if 1 - static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex z) { + static CYTHON_INLINE long double __Pyx_c_abs_long__double(__pyx_t_long_double_complex z) { #if !defined(HAVE_HYPOT) || defined(_MSC_VER) - return sqrt(z.real*z.real + z.imag*z.imag); + return sqrtl(z.real*z.real + z.imag*z.imag); #else - return hypot(z.real, z.imag); + return hypotl(z.real, z.imag); #endif } - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex a, __pyx_t_double_complex b) { - __pyx_t_double_complex z; - double r, lnr, theta, z_r, z_theta; + static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_pow_long__double(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) { + __pyx_t_long_double_complex z; + long double r, lnr, theta, z_r, z_theta; if (b.imag == 0 && b.real == (int)b.real) { if (b.real < 0) { - double denom = a.real * a.real + a.imag * a.imag; + long double denom = a.real * a.real + a.imag * a.imag; a.real = a.real / denom; a.imag = -a.imag / denom; b.real = -b.real; @@ -30891,20 +31608,20 @@ static int __Pyx_ValidateAndInit_memviewslice( case 1: return a; case 2: - return __Pyx_c_prod_double(a, a); + return __Pyx_c_prod_long__double(a, a); case 3: - z = __Pyx_c_prod_double(a, a); - return __Pyx_c_prod_double(z, a); + z = __Pyx_c_prod_long__double(a, a); + return __Pyx_c_prod_long__double(z, a); case 4: - z = __Pyx_c_prod_double(a, a); - return __Pyx_c_prod_double(z, z); + z = __Pyx_c_prod_long__double(a, a); + return __Pyx_c_prod_long__double(z, z); } } if (a.imag == 0) { if (a.real == 0) { return a; } else if ((b.imag == 0) && (a.real >= 0)) { - z.real = pow(a.real, b.real); + z.real = powl(a.real, b.real); z.imag = 0; return z; } else if (a.real > 0) { @@ -30912,17 +31629,17 @@ static int __Pyx_ValidateAndInit_memviewslice( theta = 0; } else { r = -a.real; - theta = atan2(0.0, -1.0); + theta = atan2l(0.0, -1.0); } } else { - r = __Pyx_c_abs_double(a); - theta = atan2(a.imag, a.real); + r = __Pyx_c_abs_long__double(a); + theta = atan2l(a.imag, a.real); } - lnr = log(r); - z_r = exp(lnr * b.real - theta * b.imag); + lnr = logl(r); + z_r = expl(lnr * b.real - theta * b.imag); z_theta = theta * b.real + lnr * b.imag; - z.real = z_r * cos(z_theta); - z.imag = z_r * sin(z_theta); + z.real = z_r * cosl(z_theta); + z.imag = z_r * sinl(z_theta); return z; } #endif @@ -31161,15 +31878,22 @@ static CYTHON_INLINE void __Pyx_XCLEAR_MEMVIEW(__Pyx_memviewslice *memslice, } } { - int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; -#if !CYTHON_COMPILING_IN_LIMITED_API +#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 + if (is_unsigned) { + return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); + } else { + return PyLong_FromNativeBytes(bytes, sizeof(value), -1); + } +#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 + int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(npy_int64), little, !is_unsigned); #else + int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; - from_bytes = PyObject_GetAttrString((PyObject*)&PyInt_Type, "from_bytes"); + from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(npy_int64)); if (!py_bytes) goto limited_bad; @@ -31177,16 +31901,18 @@ static CYTHON_INLINE void __Pyx_XCLEAR_MEMVIEW(__Pyx_memviewslice *memslice, if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; - kwds = PyDict_New(); - if (!kwds) goto limited_bad; - if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(!is_unsigned ? Py_True : Py_False))) goto limited_bad; + if (!is_unsigned) { + kwds = PyDict_New(); + if (!kwds) goto limited_bad; + if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; + } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: - Py_XDECREF(from_bytes); - Py_XDECREF(py_bytes); - Py_XDECREF(order_str); - Py_XDECREF(arg_tuple); Py_XDECREF(kwds); + Py_XDECREF(arg_tuple); + Py_XDECREF(order_str); + Py_XDECREF(py_bytes); + Py_XDECREF(from_bytes); return result; #endif } @@ -31214,245 +31940,239 @@ static CYTHON_INLINE void __Pyx_XCLEAR_MEMVIEW(__Pyx_memviewslice *memslice, } return (npy_int64) val; } - } else + } #endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { + if (unlikely(!PyLong_Check(x))) { + npy_int64 val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (npy_int64) -1; + val = __Pyx_PyInt_As_npy_int64(tmp); + Py_DECREF(tmp); + return val; + } + if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS - if (unlikely(__Pyx_PyLong_IsNeg(x))) { - goto raise_neg_overflow; - } else if (__Pyx_PyLong_IsCompact(x)) { - __PYX_VERIFY_RETURN_INT(npy_int64, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) - } else { - const digit* digits = __Pyx_PyLong_Digits(x); - assert(__Pyx_PyLong_DigitCount(x) > 1); - switch (__Pyx_PyLong_DigitCount(x)) { - case 2: - if ((8 * sizeof(npy_int64) > 1 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(npy_int64, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(npy_int64) >= 2 * PyLong_SHIFT)) { - return (npy_int64) (((((npy_int64)digits[1]) << PyLong_SHIFT) | (npy_int64)digits[0])); - } + if (unlikely(__Pyx_PyLong_IsNeg(x))) { + goto raise_neg_overflow; + } else if (__Pyx_PyLong_IsCompact(x)) { + __PYX_VERIFY_RETURN_INT(npy_int64, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) + } else { + const digit* digits = __Pyx_PyLong_Digits(x); + assert(__Pyx_PyLong_DigitCount(x) > 1); + switch (__Pyx_PyLong_DigitCount(x)) { + case 2: + if ((8 * sizeof(npy_int64) > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(npy_int64, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(npy_int64) >= 2 * PyLong_SHIFT)) { + return (npy_int64) (((((npy_int64)digits[1]) << PyLong_SHIFT) | (npy_int64)digits[0])); } - break; - case 3: - if ((8 * sizeof(npy_int64) > 2 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(npy_int64, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(npy_int64) >= 3 * PyLong_SHIFT)) { - return (npy_int64) (((((((npy_int64)digits[2]) << PyLong_SHIFT) | (npy_int64)digits[1]) << PyLong_SHIFT) | (npy_int64)digits[0])); - } + } + break; + case 3: + if ((8 * sizeof(npy_int64) > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(npy_int64, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(npy_int64) >= 3 * PyLong_SHIFT)) { + return (npy_int64) (((((((npy_int64)digits[2]) << PyLong_SHIFT) | (npy_int64)digits[1]) << PyLong_SHIFT) | (npy_int64)digits[0])); } - break; - case 4: - if ((8 * sizeof(npy_int64) > 3 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(npy_int64, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(npy_int64) >= 4 * PyLong_SHIFT)) { - return (npy_int64) (((((((((npy_int64)digits[3]) << PyLong_SHIFT) | (npy_int64)digits[2]) << PyLong_SHIFT) | (npy_int64)digits[1]) << PyLong_SHIFT) | (npy_int64)digits[0])); - } + } + break; + case 4: + if ((8 * sizeof(npy_int64) > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(npy_int64, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(npy_int64) >= 4 * PyLong_SHIFT)) { + return (npy_int64) (((((((((npy_int64)digits[3]) << PyLong_SHIFT) | (npy_int64)digits[2]) << PyLong_SHIFT) | (npy_int64)digits[1]) << PyLong_SHIFT) | (npy_int64)digits[0])); } - break; - } + } + break; } + } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 - if (unlikely(Py_SIZE(x) < 0)) { - goto raise_neg_overflow; - } + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } #else - { - int result = PyObject_RichCompareBool(x, Py_False, Py_LT); - if (unlikely(result < 0)) - return (npy_int64) -1; - if (unlikely(result == 1)) - goto raise_neg_overflow; - } + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (npy_int64) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } #endif - if ((sizeof(npy_int64) <= sizeof(unsigned long))) { - __PYX_VERIFY_RETURN_INT_EXC(npy_int64, unsigned long, PyLong_AsUnsignedLong(x)) + if ((sizeof(npy_int64) <= sizeof(unsigned long))) { + __PYX_VERIFY_RETURN_INT_EXC(npy_int64, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG - } else if ((sizeof(npy_int64) <= sizeof(unsigned PY_LONG_LONG))) { - __PYX_VERIFY_RETURN_INT_EXC(npy_int64, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) + } else if ((sizeof(npy_int64) <= sizeof(unsigned PY_LONG_LONG))) { + __PYX_VERIFY_RETURN_INT_EXC(npy_int64, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif - } - } else { + } + } else { #if CYTHON_USE_PYLONG_INTERNALS - if (__Pyx_PyLong_IsCompact(x)) { - __PYX_VERIFY_RETURN_INT(npy_int64, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) - } else { - const digit* digits = __Pyx_PyLong_Digits(x); - assert(__Pyx_PyLong_DigitCount(x) > 1); - switch (__Pyx_PyLong_SignedDigitCount(x)) { - case -2: - if ((8 * sizeof(npy_int64) - 1 > 1 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(npy_int64, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(npy_int64) - 1 > 2 * PyLong_SHIFT)) { - return (npy_int64) (((npy_int64)-1)*(((((npy_int64)digits[1]) << PyLong_SHIFT) | (npy_int64)digits[0]))); - } + if (__Pyx_PyLong_IsCompact(x)) { + __PYX_VERIFY_RETURN_INT(npy_int64, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) + } else { + const digit* digits = __Pyx_PyLong_Digits(x); + assert(__Pyx_PyLong_DigitCount(x) > 1); + switch (__Pyx_PyLong_SignedDigitCount(x)) { + case -2: + if ((8 * sizeof(npy_int64) - 1 > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(npy_int64, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(npy_int64) - 1 > 2 * PyLong_SHIFT)) { + return (npy_int64) (((npy_int64)-1)*(((((npy_int64)digits[1]) << PyLong_SHIFT) | (npy_int64)digits[0]))); } - break; - case 2: - if ((8 * sizeof(npy_int64) > 1 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(npy_int64, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(npy_int64) - 1 > 2 * PyLong_SHIFT)) { - return (npy_int64) ((((((npy_int64)digits[1]) << PyLong_SHIFT) | (npy_int64)digits[0]))); - } + } + break; + case 2: + if ((8 * sizeof(npy_int64) > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(npy_int64, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(npy_int64) - 1 > 2 * PyLong_SHIFT)) { + return (npy_int64) ((((((npy_int64)digits[1]) << PyLong_SHIFT) | (npy_int64)digits[0]))); } - break; - case -3: - if ((8 * sizeof(npy_int64) - 1 > 2 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(npy_int64, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(npy_int64) - 1 > 3 * PyLong_SHIFT)) { - return (npy_int64) (((npy_int64)-1)*(((((((npy_int64)digits[2]) << PyLong_SHIFT) | (npy_int64)digits[1]) << PyLong_SHIFT) | (npy_int64)digits[0]))); - } + } + break; + case -3: + if ((8 * sizeof(npy_int64) - 1 > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(npy_int64, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(npy_int64) - 1 > 3 * PyLong_SHIFT)) { + return (npy_int64) (((npy_int64)-1)*(((((((npy_int64)digits[2]) << PyLong_SHIFT) | (npy_int64)digits[1]) << PyLong_SHIFT) | (npy_int64)digits[0]))); } - break; - case 3: - if ((8 * sizeof(npy_int64) > 2 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(npy_int64, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(npy_int64) - 1 > 3 * PyLong_SHIFT)) { - return (npy_int64) ((((((((npy_int64)digits[2]) << PyLong_SHIFT) | (npy_int64)digits[1]) << PyLong_SHIFT) | (npy_int64)digits[0]))); - } + } + break; + case 3: + if ((8 * sizeof(npy_int64) > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(npy_int64, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(npy_int64) - 1 > 3 * PyLong_SHIFT)) { + return (npy_int64) ((((((((npy_int64)digits[2]) << PyLong_SHIFT) | (npy_int64)digits[1]) << PyLong_SHIFT) | (npy_int64)digits[0]))); } - break; - case -4: - if ((8 * sizeof(npy_int64) - 1 > 3 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(npy_int64, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(npy_int64) - 1 > 4 * PyLong_SHIFT)) { - return (npy_int64) (((npy_int64)-1)*(((((((((npy_int64)digits[3]) << PyLong_SHIFT) | (npy_int64)digits[2]) << PyLong_SHIFT) | (npy_int64)digits[1]) << PyLong_SHIFT) | (npy_int64)digits[0]))); - } + } + break; + case -4: + if ((8 * sizeof(npy_int64) - 1 > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(npy_int64, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(npy_int64) - 1 > 4 * PyLong_SHIFT)) { + return (npy_int64) (((npy_int64)-1)*(((((((((npy_int64)digits[3]) << PyLong_SHIFT) | (npy_int64)digits[2]) << PyLong_SHIFT) | (npy_int64)digits[1]) << PyLong_SHIFT) | (npy_int64)digits[0]))); } - break; - case 4: - if ((8 * sizeof(npy_int64) > 3 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(npy_int64, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(npy_int64) - 1 > 4 * PyLong_SHIFT)) { - return (npy_int64) ((((((((((npy_int64)digits[3]) << PyLong_SHIFT) | (npy_int64)digits[2]) << PyLong_SHIFT) | (npy_int64)digits[1]) << PyLong_SHIFT) | (npy_int64)digits[0]))); - } + } + break; + case 4: + if ((8 * sizeof(npy_int64) > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(npy_int64, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(npy_int64) - 1 > 4 * PyLong_SHIFT)) { + return (npy_int64) ((((((((((npy_int64)digits[3]) << PyLong_SHIFT) | (npy_int64)digits[2]) << PyLong_SHIFT) | (npy_int64)digits[1]) << PyLong_SHIFT) | (npy_int64)digits[0]))); } - break; - } + } + break; } + } #endif - if ((sizeof(npy_int64) <= sizeof(long))) { - __PYX_VERIFY_RETURN_INT_EXC(npy_int64, long, PyLong_AsLong(x)) + if ((sizeof(npy_int64) <= sizeof(long))) { + __PYX_VERIFY_RETURN_INT_EXC(npy_int64, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG - } else if ((sizeof(npy_int64) <= sizeof(PY_LONG_LONG))) { - __PYX_VERIFY_RETURN_INT_EXC(npy_int64, PY_LONG_LONG, PyLong_AsLongLong(x)) + } else if ((sizeof(npy_int64) <= sizeof(PY_LONG_LONG))) { + __PYX_VERIFY_RETURN_INT_EXC(npy_int64, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif - } + } + } + { + npy_int64 val; + int ret = -1; +#if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API + Py_ssize_t bytes_copied = PyLong_AsNativeBytes( + x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0)); + if (unlikely(bytes_copied == -1)) { + } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) { + goto raise_overflow; + } else { + ret = 0; + } +#elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + ret = _PyLong_AsByteArray((PyLongObject *)x, + bytes, sizeof(val), + is_little, !is_unsigned); +#else + PyObject *v; + PyObject *stepval = NULL, *mask = NULL, *shift = NULL; + int bits, remaining_bits, is_negative = 0; + int chunk_size = (sizeof(long) < 8) ? 30 : 62; + if (likely(PyLong_CheckExact(x))) { + v = __Pyx_NewRef(x); + } else { + v = PyNumber_Long(x); + if (unlikely(!v)) return (npy_int64) -1; + assert(PyLong_CheckExact(v)); } { - npy_int64 val; - PyObject *v = __Pyx_PyNumber_IntOrLong(x); -#if PY_MAJOR_VERSION < 3 - if (likely(v) && !PyLong_Check(v)) { - PyObject *tmp = v; - v = PyNumber_Long(tmp); - Py_DECREF(tmp); - } -#endif - if (likely(v)) { - int ret = -1; -#if !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) - int one = 1; int is_little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&val; - ret = _PyLong_AsByteArray((PyLongObject *)v, - bytes, sizeof(val), - is_little, !is_unsigned); -#else - PyObject *stepval = NULL, *mask = NULL, *shift = NULL; - int bits, remaining_bits, is_negative = 0; - long idigit; - int chunk_size = (sizeof(long) < 8) ? 30 : 62; - if (unlikely(!PyLong_CheckExact(v))) { - PyObject *tmp = v; - v = PyNumber_Long(v); - assert(PyLong_CheckExact(v)); - Py_DECREF(tmp); - if (unlikely(!v)) return (npy_int64) -1; - } -#if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 - if (Py_SIZE(x) == 0) - return (npy_int64) 0; - is_negative = Py_SIZE(x) < 0; -#else - { - int result = PyObject_RichCompareBool(x, Py_False, Py_LT); - if (unlikely(result < 0)) - return (npy_int64) -1; - is_negative = result == 1; - } -#endif - if (is_unsigned && unlikely(is_negative)) { - goto raise_neg_overflow; - } else if (is_negative) { - stepval = PyNumber_Invert(v); - if (unlikely(!stepval)) - return (npy_int64) -1; - } else { - stepval = __Pyx_NewRef(v); - } - val = (npy_int64) 0; - mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; - shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; - for (bits = 0; bits < (int) sizeof(npy_int64) * 8 - chunk_size; bits += chunk_size) { - PyObject *tmp, *digit; - digit = PyNumber_And(stepval, mask); - if (unlikely(!digit)) goto done; - idigit = PyLong_AsLong(digit); - Py_DECREF(digit); - if (unlikely(idigit < 0)) goto done; - tmp = PyNumber_Rshift(stepval, shift); - if (unlikely(!tmp)) goto done; - Py_DECREF(stepval); stepval = tmp; - val |= ((npy_int64) idigit) << bits; - #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 - if (Py_SIZE(stepval) == 0) - goto unpacking_done; - #endif - } - idigit = PyLong_AsLong(stepval); - if (unlikely(idigit < 0)) goto done; - remaining_bits = ((int) sizeof(npy_int64) * 8) - bits - (is_unsigned ? 0 : 1); - if (unlikely(idigit >= (1L << remaining_bits))) - goto raise_overflow; - val |= ((npy_int64) idigit) << bits; - #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 - unpacking_done: - #endif - if (!is_unsigned) { - if (unlikely(val & (((npy_int64) 1) << (sizeof(npy_int64) * 8 - 1)))) - goto raise_overflow; - if (is_negative) - val = ~val; - } - ret = 0; - done: - Py_XDECREF(shift); - Py_XDECREF(mask); - Py_XDECREF(stepval); -#endif + int result = PyObject_RichCompareBool(v, Py_False, Py_LT); + if (unlikely(result < 0)) { Py_DECREF(v); - if (likely(!ret)) - return val; + return (npy_int64) -1; } + is_negative = result == 1; + } + if (is_unsigned && unlikely(is_negative)) { + Py_DECREF(v); + goto raise_neg_overflow; + } else if (is_negative) { + stepval = PyNumber_Invert(v); + Py_DECREF(v); + if (unlikely(!stepval)) + return (npy_int64) -1; + } else { + stepval = v; + } + v = NULL; + val = (npy_int64) 0; + mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; + shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; + for (bits = 0; bits < (int) sizeof(npy_int64) * 8 - chunk_size; bits += chunk_size) { + PyObject *tmp, *digit; + long idigit; + digit = PyNumber_And(stepval, mask); + if (unlikely(!digit)) goto done; + idigit = PyLong_AsLong(digit); + Py_DECREF(digit); + if (unlikely(idigit < 0)) goto done; + val |= ((npy_int64) idigit) << bits; + tmp = PyNumber_Rshift(stepval, shift); + if (unlikely(!tmp)) goto done; + Py_DECREF(stepval); stepval = tmp; + } + Py_DECREF(shift); shift = NULL; + Py_DECREF(mask); mask = NULL; + { + long idigit = PyLong_AsLong(stepval); + if (unlikely(idigit < 0)) goto done; + remaining_bits = ((int) sizeof(npy_int64) * 8) - bits - (is_unsigned ? 0 : 1); + if (unlikely(idigit >= (1L << remaining_bits))) + goto raise_overflow; + val |= ((npy_int64) idigit) << bits; + } + if (!is_unsigned) { + if (unlikely(val & (((npy_int64) 1) << (sizeof(npy_int64) * 8 - 1)))) + goto raise_overflow; + if (is_negative) + val = ~val; + } + ret = 0; + done: + Py_XDECREF(shift); + Py_XDECREF(mask); + Py_XDECREF(stepval); +#endif + if (unlikely(ret)) return (npy_int64) -1; - } - } else { - npy_int64 val; - PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); - if (!tmp) return (npy_int64) -1; - val = __Pyx_PyInt_As_npy_int64(tmp); - Py_DECREF(tmp); return val; } raise_overflow: @@ -31496,15 +32216,22 @@ static CYTHON_INLINE void __Pyx_XCLEAR_MEMVIEW(__Pyx_memviewslice *memslice, } } { - int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; -#if !CYTHON_COMPILING_IN_LIMITED_API +#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 + if (is_unsigned) { + return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); + } else { + return PyLong_FromNativeBytes(bytes, sizeof(value), -1); + } +#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 + int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(long), little, !is_unsigned); #else + int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; - from_bytes = PyObject_GetAttrString((PyObject*)&PyInt_Type, "from_bytes"); + from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(long)); if (!py_bytes) goto limited_bad; @@ -31512,78 +32239,18 @@ static CYTHON_INLINE void __Pyx_XCLEAR_MEMVIEW(__Pyx_memviewslice *memslice, if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; - kwds = PyDict_New(); - if (!kwds) goto limited_bad; - if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(!is_unsigned ? Py_True : Py_False))) goto limited_bad; - result = PyObject_Call(from_bytes, arg_tuple, kwds); - limited_bad: - Py_XDECREF(from_bytes); - Py_XDECREF(py_bytes); - Py_XDECREF(order_str); - Py_XDECREF(arg_tuple); - Py_XDECREF(kwds); - return result; -#endif - } -} - -/* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_long(npy_long value) { -#ifdef __Pyx_HAS_GCC_DIAGNOSTIC -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wconversion" -#endif - const npy_long neg_one = (npy_long) -1, const_zero = (npy_long) 0; -#ifdef __Pyx_HAS_GCC_DIAGNOSTIC -#pragma GCC diagnostic pop -#endif - const int is_unsigned = neg_one > const_zero; - if (is_unsigned) { - if (sizeof(npy_long) < sizeof(long)) { - return PyInt_FromLong((long) value); - } else if (sizeof(npy_long) <= sizeof(unsigned long)) { - return PyLong_FromUnsignedLong((unsigned long) value); -#ifdef HAVE_LONG_LONG - } else if (sizeof(npy_long) <= sizeof(unsigned PY_LONG_LONG)) { - return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); -#endif - } - } else { - if (sizeof(npy_long) <= sizeof(long)) { - return PyInt_FromLong((long) value); -#ifdef HAVE_LONG_LONG - } else if (sizeof(npy_long) <= sizeof(PY_LONG_LONG)) { - return PyLong_FromLongLong((PY_LONG_LONG) value); -#endif + if (!is_unsigned) { + kwds = PyDict_New(); + if (!kwds) goto limited_bad; + if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } - } - { - int one = 1; int little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&value; -#if !CYTHON_COMPILING_IN_LIMITED_API - return _PyLong_FromByteArray(bytes, sizeof(npy_long), - little, !is_unsigned); -#else - PyObject *from_bytes, *result = NULL; - PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; - from_bytes = PyObject_GetAttrString((PyObject*)&PyInt_Type, "from_bytes"); - if (!from_bytes) return NULL; - py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(npy_long)); - if (!py_bytes) goto limited_bad; - order_str = PyUnicode_FromString(little ? "little" : "big"); - if (!order_str) goto limited_bad; - arg_tuple = PyTuple_Pack(2, py_bytes, order_str); - if (!arg_tuple) goto limited_bad; - kwds = PyDict_New(); - if (!kwds) goto limited_bad; - if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(!is_unsigned ? Py_True : Py_False))) goto limited_bad; result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: - Py_XDECREF(from_bytes); - Py_XDECREF(py_bytes); - Py_XDECREF(order_str); - Py_XDECREF(arg_tuple); Py_XDECREF(kwds); + Py_XDECREF(arg_tuple); + Py_XDECREF(order_str); + Py_XDECREF(py_bytes); + Py_XDECREF(from_bytes); return result; #endif } @@ -31611,245 +32278,239 @@ static CYTHON_INLINE void __Pyx_XCLEAR_MEMVIEW(__Pyx_memviewslice *memslice, } return (int) val; } - } else + } #endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { + if (unlikely(!PyLong_Check(x))) { + int val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (int) -1; + val = __Pyx_PyInt_As_int(tmp); + Py_DECREF(tmp); + return val; + } + if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS - if (unlikely(__Pyx_PyLong_IsNeg(x))) { - goto raise_neg_overflow; - } else if (__Pyx_PyLong_IsCompact(x)) { - __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) - } else { - const digit* digits = __Pyx_PyLong_Digits(x); - assert(__Pyx_PyLong_DigitCount(x) > 1); - switch (__Pyx_PyLong_DigitCount(x)) { - case 2: - if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(int) >= 2 * PyLong_SHIFT)) { - return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); - } + if (unlikely(__Pyx_PyLong_IsNeg(x))) { + goto raise_neg_overflow; + } else if (__Pyx_PyLong_IsCompact(x)) { + __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) + } else { + const digit* digits = __Pyx_PyLong_Digits(x); + assert(__Pyx_PyLong_DigitCount(x) > 1); + switch (__Pyx_PyLong_DigitCount(x)) { + case 2: + if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) >= 2 * PyLong_SHIFT)) { + return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } - break; - case 3: - if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(int) >= 3 * PyLong_SHIFT)) { - return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); - } + } + break; + case 3: + if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) >= 3 * PyLong_SHIFT)) { + return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } - break; - case 4: - if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(int) >= 4 * PyLong_SHIFT)) { - return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); - } + } + break; + case 4: + if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) >= 4 * PyLong_SHIFT)) { + return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } - break; - } + } + break; } + } #endif -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 - if (unlikely(Py_SIZE(x) < 0)) { - goto raise_neg_overflow; - } +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } #else - { - int result = PyObject_RichCompareBool(x, Py_False, Py_LT); - if (unlikely(result < 0)) - return (int) -1; - if (unlikely(result == 1)) - goto raise_neg_overflow; - } + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (int) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } #endif - if ((sizeof(int) <= sizeof(unsigned long))) { - __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) + if ((sizeof(int) <= sizeof(unsigned long))) { + __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG - } else if ((sizeof(int) <= sizeof(unsigned PY_LONG_LONG))) { - __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) + } else if ((sizeof(int) <= sizeof(unsigned PY_LONG_LONG))) { + __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif - } - } else { + } + } else { #if CYTHON_USE_PYLONG_INTERNALS - if (__Pyx_PyLong_IsCompact(x)) { - __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) - } else { - const digit* digits = __Pyx_PyLong_Digits(x); - assert(__Pyx_PyLong_DigitCount(x) > 1); - switch (__Pyx_PyLong_SignedDigitCount(x)) { - case -2: - if ((8 * sizeof(int) - 1 > 1 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { - return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); - } + if (__Pyx_PyLong_IsCompact(x)) { + __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) + } else { + const digit* digits = __Pyx_PyLong_Digits(x); + assert(__Pyx_PyLong_DigitCount(x) > 1); + switch (__Pyx_PyLong_SignedDigitCount(x)) { + case -2: + if ((8 * sizeof(int) - 1 > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { + return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } - break; - case 2: - if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { - return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); - } + } + break; + case 2: + if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { + return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } - break; - case -3: - if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { - return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); - } + } + break; + case -3: + if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { + return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } - break; - case 3: - if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { - return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); - } + } + break; + case 3: + if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { + return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } - break; - case -4: - if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { - return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); - } + } + break; + case -4: + if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { + return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } - break; - case 4: - if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { - return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); - } + } + break; + case 4: + if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { + return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } - break; - } + } + break; } + } #endif - if ((sizeof(int) <= sizeof(long))) { - __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) + if ((sizeof(int) <= sizeof(long))) { + __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG - } else if ((sizeof(int) <= sizeof(PY_LONG_LONG))) { - __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) + } else if ((sizeof(int) <= sizeof(PY_LONG_LONG))) { + __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif - } + } + } + { + int val; + int ret = -1; +#if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API + Py_ssize_t bytes_copied = PyLong_AsNativeBytes( + x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0)); + if (unlikely(bytes_copied == -1)) { + } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) { + goto raise_overflow; + } else { + ret = 0; + } +#elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + ret = _PyLong_AsByteArray((PyLongObject *)x, + bytes, sizeof(val), + is_little, !is_unsigned); +#else + PyObject *v; + PyObject *stepval = NULL, *mask = NULL, *shift = NULL; + int bits, remaining_bits, is_negative = 0; + int chunk_size = (sizeof(long) < 8) ? 30 : 62; + if (likely(PyLong_CheckExact(x))) { + v = __Pyx_NewRef(x); + } else { + v = PyNumber_Long(x); + if (unlikely(!v)) return (int) -1; + assert(PyLong_CheckExact(v)); } { - int val; - PyObject *v = __Pyx_PyNumber_IntOrLong(x); -#if PY_MAJOR_VERSION < 3 - if (likely(v) && !PyLong_Check(v)) { - PyObject *tmp = v; - v = PyNumber_Long(tmp); - Py_DECREF(tmp); - } -#endif - if (likely(v)) { - int ret = -1; -#if !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) - int one = 1; int is_little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&val; - ret = _PyLong_AsByteArray((PyLongObject *)v, - bytes, sizeof(val), - is_little, !is_unsigned); -#else - PyObject *stepval = NULL, *mask = NULL, *shift = NULL; - int bits, remaining_bits, is_negative = 0; - long idigit; - int chunk_size = (sizeof(long) < 8) ? 30 : 62; - if (unlikely(!PyLong_CheckExact(v))) { - PyObject *tmp = v; - v = PyNumber_Long(v); - assert(PyLong_CheckExact(v)); - Py_DECREF(tmp); - if (unlikely(!v)) return (int) -1; - } -#if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 - if (Py_SIZE(x) == 0) - return (int) 0; - is_negative = Py_SIZE(x) < 0; -#else - { - int result = PyObject_RichCompareBool(x, Py_False, Py_LT); - if (unlikely(result < 0)) - return (int) -1; - is_negative = result == 1; - } -#endif - if (is_unsigned && unlikely(is_negative)) { - goto raise_neg_overflow; - } else if (is_negative) { - stepval = PyNumber_Invert(v); - if (unlikely(!stepval)) - return (int) -1; - } else { - stepval = __Pyx_NewRef(v); - } - val = (int) 0; - mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; - shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; - for (bits = 0; bits < (int) sizeof(int) * 8 - chunk_size; bits += chunk_size) { - PyObject *tmp, *digit; - digit = PyNumber_And(stepval, mask); - if (unlikely(!digit)) goto done; - idigit = PyLong_AsLong(digit); - Py_DECREF(digit); - if (unlikely(idigit < 0)) goto done; - tmp = PyNumber_Rshift(stepval, shift); - if (unlikely(!tmp)) goto done; - Py_DECREF(stepval); stepval = tmp; - val |= ((int) idigit) << bits; - #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 - if (Py_SIZE(stepval) == 0) - goto unpacking_done; - #endif - } - idigit = PyLong_AsLong(stepval); - if (unlikely(idigit < 0)) goto done; - remaining_bits = ((int) sizeof(int) * 8) - bits - (is_unsigned ? 0 : 1); - if (unlikely(idigit >= (1L << remaining_bits))) - goto raise_overflow; - val |= ((int) idigit) << bits; - #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 - unpacking_done: - #endif - if (!is_unsigned) { - if (unlikely(val & (((int) 1) << (sizeof(int) * 8 - 1)))) - goto raise_overflow; - if (is_negative) - val = ~val; - } - ret = 0; - done: - Py_XDECREF(shift); - Py_XDECREF(mask); - Py_XDECREF(stepval); -#endif + int result = PyObject_RichCompareBool(v, Py_False, Py_LT); + if (unlikely(result < 0)) { Py_DECREF(v); - if (likely(!ret)) - return val; + return (int) -1; } + is_negative = result == 1; + } + if (is_unsigned && unlikely(is_negative)) { + Py_DECREF(v); + goto raise_neg_overflow; + } else if (is_negative) { + stepval = PyNumber_Invert(v); + Py_DECREF(v); + if (unlikely(!stepval)) + return (int) -1; + } else { + stepval = v; + } + v = NULL; + val = (int) 0; + mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; + shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; + for (bits = 0; bits < (int) sizeof(int) * 8 - chunk_size; bits += chunk_size) { + PyObject *tmp, *digit; + long idigit; + digit = PyNumber_And(stepval, mask); + if (unlikely(!digit)) goto done; + idigit = PyLong_AsLong(digit); + Py_DECREF(digit); + if (unlikely(idigit < 0)) goto done; + val |= ((int) idigit) << bits; + tmp = PyNumber_Rshift(stepval, shift); + if (unlikely(!tmp)) goto done; + Py_DECREF(stepval); stepval = tmp; + } + Py_DECREF(shift); shift = NULL; + Py_DECREF(mask); mask = NULL; + { + long idigit = PyLong_AsLong(stepval); + if (unlikely(idigit < 0)) goto done; + remaining_bits = ((int) sizeof(int) * 8) - bits - (is_unsigned ? 0 : 1); + if (unlikely(idigit >= (1L << remaining_bits))) + goto raise_overflow; + val |= ((int) idigit) << bits; + } + if (!is_unsigned) { + if (unlikely(val & (((int) 1) << (sizeof(int) * 8 - 1)))) + goto raise_overflow; + if (is_negative) + val = ~val; + } + ret = 0; + done: + Py_XDECREF(shift); + Py_XDECREF(mask); + Py_XDECREF(stepval); +#endif + if (unlikely(ret)) return (int) -1; - } - } else { - int val; - PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); - if (!tmp) return (int) -1; - val = __Pyx_PyInt_As_int(tmp); - Py_DECREF(tmp); return val; } raise_overflow: @@ -31884,245 +32545,239 @@ static CYTHON_INLINE void __Pyx_XCLEAR_MEMVIEW(__Pyx_memviewslice *memslice, } return (long) val; } - } else + } #endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { + if (unlikely(!PyLong_Check(x))) { + long val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (long) -1; + val = __Pyx_PyInt_As_long(tmp); + Py_DECREF(tmp); + return val; + } + if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS - if (unlikely(__Pyx_PyLong_IsNeg(x))) { - goto raise_neg_overflow; - } else if (__Pyx_PyLong_IsCompact(x)) { - __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) - } else { - const digit* digits = __Pyx_PyLong_Digits(x); - assert(__Pyx_PyLong_DigitCount(x) > 1); - switch (__Pyx_PyLong_DigitCount(x)) { - case 2: - if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(long) >= 2 * PyLong_SHIFT)) { - return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); - } + if (unlikely(__Pyx_PyLong_IsNeg(x))) { + goto raise_neg_overflow; + } else if (__Pyx_PyLong_IsCompact(x)) { + __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) + } else { + const digit* digits = __Pyx_PyLong_Digits(x); + assert(__Pyx_PyLong_DigitCount(x) > 1); + switch (__Pyx_PyLong_DigitCount(x)) { + case 2: + if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) >= 2 * PyLong_SHIFT)) { + return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } - break; - case 3: - if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(long) >= 3 * PyLong_SHIFT)) { - return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); - } + } + break; + case 3: + if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) >= 3 * PyLong_SHIFT)) { + return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } - break; - case 4: - if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(long) >= 4 * PyLong_SHIFT)) { - return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); - } + } + break; + case 4: + if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) >= 4 * PyLong_SHIFT)) { + return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } - break; - } + } + break; } + } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 - if (unlikely(Py_SIZE(x) < 0)) { - goto raise_neg_overflow; - } + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } #else - { - int result = PyObject_RichCompareBool(x, Py_False, Py_LT); - if (unlikely(result < 0)) - return (long) -1; - if (unlikely(result == 1)) - goto raise_neg_overflow; - } + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (long) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } #endif - if ((sizeof(long) <= sizeof(unsigned long))) { - __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) + if ((sizeof(long) <= sizeof(unsigned long))) { + __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG - } else if ((sizeof(long) <= sizeof(unsigned PY_LONG_LONG))) { - __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) + } else if ((sizeof(long) <= sizeof(unsigned PY_LONG_LONG))) { + __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif - } - } else { + } + } else { #if CYTHON_USE_PYLONG_INTERNALS - if (__Pyx_PyLong_IsCompact(x)) { - __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) - } else { - const digit* digits = __Pyx_PyLong_Digits(x); - assert(__Pyx_PyLong_DigitCount(x) > 1); - switch (__Pyx_PyLong_SignedDigitCount(x)) { - case -2: - if ((8 * sizeof(long) - 1 > 1 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { - return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); - } + if (__Pyx_PyLong_IsCompact(x)) { + __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) + } else { + const digit* digits = __Pyx_PyLong_Digits(x); + assert(__Pyx_PyLong_DigitCount(x) > 1); + switch (__Pyx_PyLong_SignedDigitCount(x)) { + case -2: + if ((8 * sizeof(long) - 1 > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { + return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } - break; - case 2: - if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { - return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); - } + } + break; + case 2: + if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { + return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } - break; - case -3: - if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { - return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); - } + } + break; + case -3: + if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { + return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } - break; - case 3: - if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { - return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); - } + } + break; + case 3: + if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { + return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } - break; - case -4: - if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { - return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); - } + } + break; + case -4: + if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { + return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } - break; - case 4: - if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { - return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); - } + } + break; + case 4: + if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { + return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } - break; - } + } + break; } + } #endif - if ((sizeof(long) <= sizeof(long))) { - __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) + if ((sizeof(long) <= sizeof(long))) { + __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG - } else if ((sizeof(long) <= sizeof(PY_LONG_LONG))) { - __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) + } else if ((sizeof(long) <= sizeof(PY_LONG_LONG))) { + __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif - } + } + } + { + long val; + int ret = -1; +#if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API + Py_ssize_t bytes_copied = PyLong_AsNativeBytes( + x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0)); + if (unlikely(bytes_copied == -1)) { + } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) { + goto raise_overflow; + } else { + ret = 0; + } +#elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + ret = _PyLong_AsByteArray((PyLongObject *)x, + bytes, sizeof(val), + is_little, !is_unsigned); +#else + PyObject *v; + PyObject *stepval = NULL, *mask = NULL, *shift = NULL; + int bits, remaining_bits, is_negative = 0; + int chunk_size = (sizeof(long) < 8) ? 30 : 62; + if (likely(PyLong_CheckExact(x))) { + v = __Pyx_NewRef(x); + } else { + v = PyNumber_Long(x); + if (unlikely(!v)) return (long) -1; + assert(PyLong_CheckExact(v)); } { - long val; - PyObject *v = __Pyx_PyNumber_IntOrLong(x); -#if PY_MAJOR_VERSION < 3 - if (likely(v) && !PyLong_Check(v)) { - PyObject *tmp = v; - v = PyNumber_Long(tmp); - Py_DECREF(tmp); - } -#endif - if (likely(v)) { - int ret = -1; -#if !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) - int one = 1; int is_little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&val; - ret = _PyLong_AsByteArray((PyLongObject *)v, - bytes, sizeof(val), - is_little, !is_unsigned); -#else - PyObject *stepval = NULL, *mask = NULL, *shift = NULL; - int bits, remaining_bits, is_negative = 0; - long idigit; - int chunk_size = (sizeof(long) < 8) ? 30 : 62; - if (unlikely(!PyLong_CheckExact(v))) { - PyObject *tmp = v; - v = PyNumber_Long(v); - assert(PyLong_CheckExact(v)); - Py_DECREF(tmp); - if (unlikely(!v)) return (long) -1; - } -#if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 - if (Py_SIZE(x) == 0) - return (long) 0; - is_negative = Py_SIZE(x) < 0; -#else - { - int result = PyObject_RichCompareBool(x, Py_False, Py_LT); - if (unlikely(result < 0)) - return (long) -1; - is_negative = result == 1; - } -#endif - if (is_unsigned && unlikely(is_negative)) { - goto raise_neg_overflow; - } else if (is_negative) { - stepval = PyNumber_Invert(v); - if (unlikely(!stepval)) - return (long) -1; - } else { - stepval = __Pyx_NewRef(v); - } - val = (long) 0; - mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; - shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; - for (bits = 0; bits < (int) sizeof(long) * 8 - chunk_size; bits += chunk_size) { - PyObject *tmp, *digit; - digit = PyNumber_And(stepval, mask); - if (unlikely(!digit)) goto done; - idigit = PyLong_AsLong(digit); - Py_DECREF(digit); - if (unlikely(idigit < 0)) goto done; - tmp = PyNumber_Rshift(stepval, shift); - if (unlikely(!tmp)) goto done; - Py_DECREF(stepval); stepval = tmp; - val |= ((long) idigit) << bits; - #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 - if (Py_SIZE(stepval) == 0) - goto unpacking_done; - #endif - } - idigit = PyLong_AsLong(stepval); - if (unlikely(idigit < 0)) goto done; - remaining_bits = ((int) sizeof(long) * 8) - bits - (is_unsigned ? 0 : 1); - if (unlikely(idigit >= (1L << remaining_bits))) - goto raise_overflow; - val |= ((long) idigit) << bits; - #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 - unpacking_done: - #endif - if (!is_unsigned) { - if (unlikely(val & (((long) 1) << (sizeof(long) * 8 - 1)))) - goto raise_overflow; - if (is_negative) - val = ~val; - } - ret = 0; - done: - Py_XDECREF(shift); - Py_XDECREF(mask); - Py_XDECREF(stepval); -#endif + int result = PyObject_RichCompareBool(v, Py_False, Py_LT); + if (unlikely(result < 0)) { Py_DECREF(v); - if (likely(!ret)) - return val; + return (long) -1; } + is_negative = result == 1; + } + if (is_unsigned && unlikely(is_negative)) { + Py_DECREF(v); + goto raise_neg_overflow; + } else if (is_negative) { + stepval = PyNumber_Invert(v); + Py_DECREF(v); + if (unlikely(!stepval)) + return (long) -1; + } else { + stepval = v; + } + v = NULL; + val = (long) 0; + mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; + shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; + for (bits = 0; bits < (int) sizeof(long) * 8 - chunk_size; bits += chunk_size) { + PyObject *tmp, *digit; + long idigit; + digit = PyNumber_And(stepval, mask); + if (unlikely(!digit)) goto done; + idigit = PyLong_AsLong(digit); + Py_DECREF(digit); + if (unlikely(idigit < 0)) goto done; + val |= ((long) idigit) << bits; + tmp = PyNumber_Rshift(stepval, shift); + if (unlikely(!tmp)) goto done; + Py_DECREF(stepval); stepval = tmp; + } + Py_DECREF(shift); shift = NULL; + Py_DECREF(mask); mask = NULL; + { + long idigit = PyLong_AsLong(stepval); + if (unlikely(idigit < 0)) goto done; + remaining_bits = ((int) sizeof(long) * 8) - bits - (is_unsigned ? 0 : 1); + if (unlikely(idigit >= (1L << remaining_bits))) + goto raise_overflow; + val |= ((long) idigit) << bits; + } + if (!is_unsigned) { + if (unlikely(val & (((long) 1) << (sizeof(long) * 8 - 1)))) + goto raise_overflow; + if (is_negative) + val = ~val; + } + ret = 0; + done: + Py_XDECREF(shift); + Py_XDECREF(mask); + Py_XDECREF(stepval); +#endif + if (unlikely(ret)) return (long) -1; - } - } else { - long val; - PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); - if (!tmp) return (long) -1; - val = __Pyx_PyInt_As_long(tmp); - Py_DECREF(tmp); return val; } raise_overflow: @@ -32166,15 +32821,22 @@ static CYTHON_INLINE void __Pyx_XCLEAR_MEMVIEW(__Pyx_memviewslice *memslice, } } { - int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; -#if !CYTHON_COMPILING_IN_LIMITED_API +#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 + if (is_unsigned) { + return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); + } else { + return PyLong_FromNativeBytes(bytes, sizeof(value), -1); + } +#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 + int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(int), little, !is_unsigned); #else + int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; - from_bytes = PyObject_GetAttrString((PyObject*)&PyInt_Type, "from_bytes"); + from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(int)); if (!py_bytes) goto limited_bad; @@ -32182,16 +32844,18 @@ static CYTHON_INLINE void __Pyx_XCLEAR_MEMVIEW(__Pyx_memviewslice *memslice, if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; - kwds = PyDict_New(); - if (!kwds) goto limited_bad; - if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(!is_unsigned ? Py_True : Py_False))) goto limited_bad; + if (!is_unsigned) { + kwds = PyDict_New(); + if (!kwds) goto limited_bad; + if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; + } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: - Py_XDECREF(from_bytes); - Py_XDECREF(py_bytes); - Py_XDECREF(order_str); - Py_XDECREF(arg_tuple); Py_XDECREF(kwds); + Py_XDECREF(arg_tuple); + Py_XDECREF(order_str); + Py_XDECREF(py_bytes); + Py_XDECREF(from_bytes); return result; #endif } @@ -32219,245 +32883,239 @@ static CYTHON_INLINE void __Pyx_XCLEAR_MEMVIEW(__Pyx_memviewslice *memslice, } return (char) val; } - } else + } #endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { + if (unlikely(!PyLong_Check(x))) { + char val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (char) -1; + val = __Pyx_PyInt_As_char(tmp); + Py_DECREF(tmp); + return val; + } + if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS - if (unlikely(__Pyx_PyLong_IsNeg(x))) { - goto raise_neg_overflow; - } else if (__Pyx_PyLong_IsCompact(x)) { - __PYX_VERIFY_RETURN_INT(char, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) - } else { - const digit* digits = __Pyx_PyLong_Digits(x); - assert(__Pyx_PyLong_DigitCount(x) > 1); - switch (__Pyx_PyLong_DigitCount(x)) { - case 2: - if ((8 * sizeof(char) > 1 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(char) >= 2 * PyLong_SHIFT)) { - return (char) (((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])); - } + if (unlikely(__Pyx_PyLong_IsNeg(x))) { + goto raise_neg_overflow; + } else if (__Pyx_PyLong_IsCompact(x)) { + __PYX_VERIFY_RETURN_INT(char, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) + } else { + const digit* digits = __Pyx_PyLong_Digits(x); + assert(__Pyx_PyLong_DigitCount(x) > 1); + switch (__Pyx_PyLong_DigitCount(x)) { + case 2: + if ((8 * sizeof(char) > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(char) >= 2 * PyLong_SHIFT)) { + return (char) (((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])); } - break; - case 3: - if ((8 * sizeof(char) > 2 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(char) >= 3 * PyLong_SHIFT)) { - return (char) (((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])); - } + } + break; + case 3: + if ((8 * sizeof(char) > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(char) >= 3 * PyLong_SHIFT)) { + return (char) (((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])); } - break; - case 4: - if ((8 * sizeof(char) > 3 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(char) >= 4 * PyLong_SHIFT)) { - return (char) (((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])); - } + } + break; + case 4: + if ((8 * sizeof(char) > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(char) >= 4 * PyLong_SHIFT)) { + return (char) (((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])); } - break; - } + } + break; } + } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 - if (unlikely(Py_SIZE(x) < 0)) { - goto raise_neg_overflow; - } + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } #else - { - int result = PyObject_RichCompareBool(x, Py_False, Py_LT); - if (unlikely(result < 0)) - return (char) -1; - if (unlikely(result == 1)) - goto raise_neg_overflow; - } + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (char) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } #endif - if ((sizeof(char) <= sizeof(unsigned long))) { - __PYX_VERIFY_RETURN_INT_EXC(char, unsigned long, PyLong_AsUnsignedLong(x)) + if ((sizeof(char) <= sizeof(unsigned long))) { + __PYX_VERIFY_RETURN_INT_EXC(char, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG - } else if ((sizeof(char) <= sizeof(unsigned PY_LONG_LONG))) { - __PYX_VERIFY_RETURN_INT_EXC(char, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) + } else if ((sizeof(char) <= sizeof(unsigned PY_LONG_LONG))) { + __PYX_VERIFY_RETURN_INT_EXC(char, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif - } - } else { + } + } else { #if CYTHON_USE_PYLONG_INTERNALS - if (__Pyx_PyLong_IsCompact(x)) { - __PYX_VERIFY_RETURN_INT(char, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) - } else { - const digit* digits = __Pyx_PyLong_Digits(x); - assert(__Pyx_PyLong_DigitCount(x) > 1); - switch (__Pyx_PyLong_SignedDigitCount(x)) { - case -2: - if ((8 * sizeof(char) - 1 > 1 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(char) - 1 > 2 * PyLong_SHIFT)) { - return (char) (((char)-1)*(((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0]))); - } + if (__Pyx_PyLong_IsCompact(x)) { + __PYX_VERIFY_RETURN_INT(char, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) + } else { + const digit* digits = __Pyx_PyLong_Digits(x); + assert(__Pyx_PyLong_DigitCount(x) > 1); + switch (__Pyx_PyLong_SignedDigitCount(x)) { + case -2: + if ((8 * sizeof(char) - 1 > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(char) - 1 > 2 * PyLong_SHIFT)) { + return (char) (((char)-1)*(((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0]))); } - break; - case 2: - if ((8 * sizeof(char) > 1 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(char) - 1 > 2 * PyLong_SHIFT)) { - return (char) ((((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0]))); - } + } + break; + case 2: + if ((8 * sizeof(char) > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(char) - 1 > 2 * PyLong_SHIFT)) { + return (char) ((((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0]))); } - break; - case -3: - if ((8 * sizeof(char) - 1 > 2 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(char) - 1 > 3 * PyLong_SHIFT)) { - return (char) (((char)-1)*(((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]))); - } + } + break; + case -3: + if ((8 * sizeof(char) - 1 > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(char) - 1 > 3 * PyLong_SHIFT)) { + return (char) (((char)-1)*(((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]))); } - break; - case 3: - if ((8 * sizeof(char) > 2 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(char) - 1 > 3 * PyLong_SHIFT)) { - return (char) ((((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]))); - } + } + break; + case 3: + if ((8 * sizeof(char) > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(char) - 1 > 3 * PyLong_SHIFT)) { + return (char) ((((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]))); } - break; - case -4: - if ((8 * sizeof(char) - 1 > 3 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(char) - 1 > 4 * PyLong_SHIFT)) { - return (char) (((char)-1)*(((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]))); - } + } + break; + case -4: + if ((8 * sizeof(char) - 1 > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(char) - 1 > 4 * PyLong_SHIFT)) { + return (char) (((char)-1)*(((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]))); } - break; - case 4: - if ((8 * sizeof(char) > 3 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(char) - 1 > 4 * PyLong_SHIFT)) { - return (char) ((((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]))); - } + } + break; + case 4: + if ((8 * sizeof(char) > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(char) - 1 > 4 * PyLong_SHIFT)) { + return (char) ((((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]))); } - break; - } + } + break; } + } #endif - if ((sizeof(char) <= sizeof(long))) { - __PYX_VERIFY_RETURN_INT_EXC(char, long, PyLong_AsLong(x)) + if ((sizeof(char) <= sizeof(long))) { + __PYX_VERIFY_RETURN_INT_EXC(char, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG - } else if ((sizeof(char) <= sizeof(PY_LONG_LONG))) { - __PYX_VERIFY_RETURN_INT_EXC(char, PY_LONG_LONG, PyLong_AsLongLong(x)) + } else if ((sizeof(char) <= sizeof(PY_LONG_LONG))) { + __PYX_VERIFY_RETURN_INT_EXC(char, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif - } + } + } + { + char val; + int ret = -1; +#if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API + Py_ssize_t bytes_copied = PyLong_AsNativeBytes( + x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0)); + if (unlikely(bytes_copied == -1)) { + } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) { + goto raise_overflow; + } else { + ret = 0; + } +#elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + ret = _PyLong_AsByteArray((PyLongObject *)x, + bytes, sizeof(val), + is_little, !is_unsigned); +#else + PyObject *v; + PyObject *stepval = NULL, *mask = NULL, *shift = NULL; + int bits, remaining_bits, is_negative = 0; + int chunk_size = (sizeof(long) < 8) ? 30 : 62; + if (likely(PyLong_CheckExact(x))) { + v = __Pyx_NewRef(x); + } else { + v = PyNumber_Long(x); + if (unlikely(!v)) return (char) -1; + assert(PyLong_CheckExact(v)); } { - char val; - PyObject *v = __Pyx_PyNumber_IntOrLong(x); -#if PY_MAJOR_VERSION < 3 - if (likely(v) && !PyLong_Check(v)) { - PyObject *tmp = v; - v = PyNumber_Long(tmp); - Py_DECREF(tmp); - } -#endif - if (likely(v)) { - int ret = -1; -#if !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) - int one = 1; int is_little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&val; - ret = _PyLong_AsByteArray((PyLongObject *)v, - bytes, sizeof(val), - is_little, !is_unsigned); -#else - PyObject *stepval = NULL, *mask = NULL, *shift = NULL; - int bits, remaining_bits, is_negative = 0; - long idigit; - int chunk_size = (sizeof(long) < 8) ? 30 : 62; - if (unlikely(!PyLong_CheckExact(v))) { - PyObject *tmp = v; - v = PyNumber_Long(v); - assert(PyLong_CheckExact(v)); - Py_DECREF(tmp); - if (unlikely(!v)) return (char) -1; - } -#if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 - if (Py_SIZE(x) == 0) - return (char) 0; - is_negative = Py_SIZE(x) < 0; -#else - { - int result = PyObject_RichCompareBool(x, Py_False, Py_LT); - if (unlikely(result < 0)) - return (char) -1; - is_negative = result == 1; - } -#endif - if (is_unsigned && unlikely(is_negative)) { - goto raise_neg_overflow; - } else if (is_negative) { - stepval = PyNumber_Invert(v); - if (unlikely(!stepval)) - return (char) -1; - } else { - stepval = __Pyx_NewRef(v); - } - val = (char) 0; - mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; - shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; - for (bits = 0; bits < (int) sizeof(char) * 8 - chunk_size; bits += chunk_size) { - PyObject *tmp, *digit; - digit = PyNumber_And(stepval, mask); - if (unlikely(!digit)) goto done; - idigit = PyLong_AsLong(digit); - Py_DECREF(digit); - if (unlikely(idigit < 0)) goto done; - tmp = PyNumber_Rshift(stepval, shift); - if (unlikely(!tmp)) goto done; - Py_DECREF(stepval); stepval = tmp; - val |= ((char) idigit) << bits; - #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 - if (Py_SIZE(stepval) == 0) - goto unpacking_done; - #endif - } - idigit = PyLong_AsLong(stepval); - if (unlikely(idigit < 0)) goto done; - remaining_bits = ((int) sizeof(char) * 8) - bits - (is_unsigned ? 0 : 1); - if (unlikely(idigit >= (1L << remaining_bits))) - goto raise_overflow; - val |= ((char) idigit) << bits; - #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 - unpacking_done: - #endif - if (!is_unsigned) { - if (unlikely(val & (((char) 1) << (sizeof(char) * 8 - 1)))) - goto raise_overflow; - if (is_negative) - val = ~val; - } - ret = 0; - done: - Py_XDECREF(shift); - Py_XDECREF(mask); - Py_XDECREF(stepval); -#endif + int result = PyObject_RichCompareBool(v, Py_False, Py_LT); + if (unlikely(result < 0)) { Py_DECREF(v); - if (likely(!ret)) - return val; + return (char) -1; } + is_negative = result == 1; + } + if (is_unsigned && unlikely(is_negative)) { + Py_DECREF(v); + goto raise_neg_overflow; + } else if (is_negative) { + stepval = PyNumber_Invert(v); + Py_DECREF(v); + if (unlikely(!stepval)) + return (char) -1; + } else { + stepval = v; + } + v = NULL; + val = (char) 0; + mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; + shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; + for (bits = 0; bits < (int) sizeof(char) * 8 - chunk_size; bits += chunk_size) { + PyObject *tmp, *digit; + long idigit; + digit = PyNumber_And(stepval, mask); + if (unlikely(!digit)) goto done; + idigit = PyLong_AsLong(digit); + Py_DECREF(digit); + if (unlikely(idigit < 0)) goto done; + val |= ((char) idigit) << bits; + tmp = PyNumber_Rshift(stepval, shift); + if (unlikely(!tmp)) goto done; + Py_DECREF(stepval); stepval = tmp; + } + Py_DECREF(shift); shift = NULL; + Py_DECREF(mask); mask = NULL; + { + long idigit = PyLong_AsLong(stepval); + if (unlikely(idigit < 0)) goto done; + remaining_bits = ((int) sizeof(char) * 8) - bits - (is_unsigned ? 0 : 1); + if (unlikely(idigit >= (1L << remaining_bits))) + goto raise_overflow; + val |= ((char) idigit) << bits; + } + if (!is_unsigned) { + if (unlikely(val & (((char) 1) << (sizeof(char) * 8 - 1)))) + goto raise_overflow; + if (is_negative) + val = ~val; + } + ret = 0; + done: + Py_XDECREF(shift); + Py_XDECREF(mask); + Py_XDECREF(stepval); +#endif + if (unlikely(ret)) return (char) -1; - } - } else { - char val; - PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); - if (!tmp) return (char) -1; - val = __Pyx_PyInt_As_char(tmp); - Py_DECREF(tmp); return val; } raise_overflow: @@ -32771,9 +33429,22 @@ PyObject *__Pyx_PyGen_Send(PyGenObject *gen, PyObject *arg) { PyErr_SetNone(PyExc_StopIteration); } else { +#if PY_VERSION_HEX < 0x030d00A1 _PyGen_SetStopIterationValue(result); +#else + if (!PyTuple_Check(result) && !PyExceptionInstance_Check(result)) { + PyErr_SetObject(PyExc_StopIteration, result); + } else { + PyObject *exc = __Pyx_PyObject_CallOneArg(PyExc_StopIteration, result); + if (likely(exc != NULL)) { + PyErr_SetObject(PyExc_StopIteration, exc); + Py_DECREF(exc); + } + } +#endif } - Py_CLEAR(result); + Py_DECREF(result); + result = NULL; } return result; #endif @@ -33533,6 +34204,9 @@ static PyTypeObject __pyx_GeneratorType_type = { #if PY_VERSION_HEX >= 0x030C0000 0, #endif +#if PY_VERSION_HEX >= 0x030d00A4 + 0, +#endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, #endif @@ -33554,7 +34228,7 @@ static int __pyx_Generator_init(PyObject *module) { } /* CheckBinaryVersion */ - static unsigned long __Pyx_get_runtime_version() { + static unsigned long __Pyx_get_runtime_version(void) { #if __PYX_LIMITED_VERSION_HEX >= 0x030B00A4 return Py_Version & ~0xFFUL; #else diff --git a/src/fastkde/nufft.c b/src/fastkde/nufft.c index 5fdbb4a..57d17e9 100644 --- a/src/fastkde/nufft.c +++ b/src/fastkde/nufft.c @@ -1,4 +1,26 @@ -/* Generated by Cython 3.0.3 */ +/* Generated by Cython 3.0.11 */ + +/* BEGIN: Cython Metadata +{ + "distutils": { + "depends": [ + "/Users/adam/phd/env_312/lib/python3.12/site-packages/numpy/_core/include/numpy/arrayobject.h", + "/Users/adam/phd/env_312/lib/python3.12/site-packages/numpy/_core/include/numpy/arrayscalars.h", + "/Users/adam/phd/env_312/lib/python3.12/site-packages/numpy/_core/include/numpy/ndarrayobject.h", + "/Users/adam/phd/env_312/lib/python3.12/site-packages/numpy/_core/include/numpy/ndarraytypes.h", + "/Users/adam/phd/env_312/lib/python3.12/site-packages/numpy/_core/include/numpy/ufuncobject.h" + ], + "include_dirs": [ + "/Users/adam/phd/env_312/lib/python3.12/site-packages/numpy/_core/include" + ], + "name": "fastkde.nufft", + "sources": [ + "src/fastkde/nufft.pyx" + ] + }, + "module_name": "fastkde.nufft" +} +END: Cython Metadata */ #ifndef PY_SSIZE_T_CLEAN #define PY_SSIZE_T_CLEAN @@ -19,15 +41,15 @@ #elif PY_VERSION_HEX < 0x02070000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) #error Cython requires Python 2.7+ or Python 3.3+. #else -#if CYTHON_LIMITED_API +#if defined(CYTHON_LIMITED_API) && CYTHON_LIMITED_API #define __PYX_EXTRA_ABI_MODULE_NAME "limited" #else #define __PYX_EXTRA_ABI_MODULE_NAME "" #endif -#define CYTHON_ABI "3_0_3" __PYX_EXTRA_ABI_MODULE_NAME +#define CYTHON_ABI "3_0_11" __PYX_EXTRA_ABI_MODULE_NAME #define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI #define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "." -#define CYTHON_HEX_VERSION 0x030003F0 +#define CYTHON_HEX_VERSION 0x03000BF0 #define CYTHON_FUTURE_DIVISION 0 #include #ifndef offsetof @@ -119,6 +141,8 @@ #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif + #undef CYTHON_USE_FREELISTS + #define CYTHON_USE_FREELISTS 0 #elif defined(PYPY_VERSION) #define CYTHON_COMPILING_IN_PYPY 1 #define CYTHON_COMPILING_IN_CPYTHON 0 @@ -180,6 +204,8 @@ #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif + #undef CYTHON_USE_FREELISTS + #define CYTHON_USE_FREELISTS 0 #elif defined(CYTHON_LIMITED_API) #ifdef Py_LIMITED_API #undef __PYX_LIMITED_VERSION_HEX @@ -241,7 +267,9 @@ #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif -#elif defined(PY_NOGIL) + #undef CYTHON_USE_FREELISTS + #define CYTHON_USE_FREELISTS 0 +#elif defined(Py_GIL_DISABLED) || defined(Py_NOGIL) #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 @@ -250,11 +278,17 @@ #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif + #ifndef CYTHON_USE_TYPE_SPECS + #define CYTHON_USE_TYPE_SPECS 0 + #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #ifndef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 1 #endif + #ifndef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #ifndef CYTHON_USE_UNICODE_INTERNALS @@ -262,8 +296,6 @@ #endif #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 - #undef CYTHON_USE_PYLONG_INTERNALS - #define CYTHON_USE_PYLONG_INTERNALS 0 #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif @@ -275,11 +307,22 @@ #endif #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_GIL + #define CYTHON_FAST_GIL 0 + #ifndef CYTHON_METH_FASTCALL + #define CYTHON_METH_FASTCALL 1 + #endif #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 + #ifndef CYTHON_PEP487_INIT_SUBCLASS + #define CYTHON_PEP487_INIT_SUBCLASS 1 + #endif #ifndef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif + #ifndef CYTHON_USE_MODULE_STATE + #define CYTHON_USE_MODULE_STATE 0 + #endif #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 1 #endif @@ -287,6 +330,12 @@ #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 + #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC + #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 + #endif + #ifndef CYTHON_USE_FREELISTS + #define CYTHON_USE_FREELISTS 0 + #endif #else #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 1 @@ -377,6 +426,9 @@ #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 #endif + #ifndef CYTHON_USE_FREELISTS + #define CYTHON_USE_FREELISTS 1 + #endif #endif #if !defined(CYTHON_FAST_PYCCALL) #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) @@ -569,18 +621,19 @@ PyObject *exception_table = NULL; PyObject *types_module=NULL, *code_type=NULL, *result=NULL; #if __PYX_LIMITED_VERSION_HEX < 0x030B0000 - PyObject *version_info; // borrowed - #endif + PyObject *version_info; PyObject *py_minor_version = NULL; + #endif long minor_version = 0; PyObject *type, *value, *traceback; PyErr_Fetch(&type, &value, &traceback); #if __PYX_LIMITED_VERSION_HEX >= 0x030B0000 - minor_version = 11; // we don't yet need to distinguish between versions > 11 + minor_version = 11; #else if (!(version_info = PySys_GetObject("version_info"))) goto end; if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end; minor_version = PyLong_AsLong(py_minor_version); + Py_DECREF(py_minor_version); if (minor_version == -1 && PyErr_Occurred()) goto end; #endif if (!(types_module = PyImport_ImportModule("types"))) goto end; @@ -601,7 +654,6 @@ Py_XDECREF(code_type); Py_XDECREF(exception_table); Py_XDECREF(types_module); - Py_XDECREF(py_minor_version); if (type) { PyErr_Restore(type, value, traceback); } @@ -634,7 +686,7 @@ PyObject *fv, PyObject *cell, PyObject* fn, PyObject *name, int fline, PyObject *lnos) { PyCodeObject *result; - PyObject *empty_bytes = PyBytes_FromStringAndSize("", 0); // we don't have access to __pyx_empty_bytes here + PyObject *empty_bytes = PyBytes_FromStringAndSize("", 0); if (!empty_bytes) return NULL; result = #if PY_VERSION_HEX >= 0x030C0000 @@ -720,8 +772,13 @@ typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames); #else - #define __Pyx_PyCFunctionFast _PyCFunctionFast - #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords + #if PY_VERSION_HEX >= 0x030d00A4 + # define __Pyx_PyCFunctionFast PyCFunctionFast + # define __Pyx_PyCFunctionFastWithKeywords PyCFunctionFastWithKeywords + #else + # define __Pyx_PyCFunctionFast _PyCFunctionFast + # define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords + #endif #endif #if CYTHON_METH_FASTCALL #define __Pyx_METH_FASTCALL METH_FASTCALL @@ -796,6 +853,8 @@ static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void *cfunc) { #define __Pyx_PyThreadState_Current PyThreadState_Get() #elif !CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_Current PyThreadState_GET() +#elif PY_VERSION_HEX >= 0x030d00A1 + #define __Pyx_PyThreadState_Current PyThreadState_GetUnchecked() #elif PY_VERSION_HEX >= 0x03060000 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() #elif PY_VERSION_HEX >= 0x03000000 @@ -871,7 +930,7 @@ static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { } #endif #endif -#if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized) +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 || defined(_PyDict_NewPresized) #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) #else #define __Pyx_PyDict_NewPresized(n) PyDict_New() @@ -883,7 +942,7 @@ static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) #endif -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030600B4 && CYTHON_USE_UNICODE_INTERNALS +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030600B4 && PY_VERSION_HEX < 0x030d0000 && CYTHON_USE_UNICODE_INTERNALS #define __Pyx_PyDict_GetItemStrWithError(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) { PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name); @@ -927,7 +986,7 @@ static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, #endif #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX >= 0x03080000 #define __Pyx_PyHeapTypeObject_GC_Del(obj) {\ - PyTypeObject *type = Py_TYPE(obj);\ + PyTypeObject *type = Py_TYPE((PyObject*)obj);\ assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\ PyObject_GC_Del(obj);\ Py_DECREF(type);\ @@ -1071,6 +1130,15 @@ static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o) #endif +#if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 + #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name) +#else + static CYTHON_INLINE PyObject *__Pyx_PyImport_AddModuleRef(const char *name) { + PyObject *module = PyImport_AddModule(name); + Py_XINCREF(module); + return module; + } +#endif #if PY_MAJOR_VERSION >= 3 #define PyIntObject PyLongObject #define PyInt_Type PyLong_Type @@ -1149,7 +1217,7 @@ static CYTHON_INLINE float __PYX_NAN() { #endif #define __PYX_MARK_ERR_POS(f_index, lineno) \ - { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; } + { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; } #define __PYX_ERR(f_index, lineno, Ln_error) \ { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; } @@ -1265,24 +1333,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) -#if CYTHON_COMPILING_IN_LIMITED_API -static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const wchar_t *u) -{ - const wchar_t *u_end = u; - while (*u_end++) ; - return (size_t)(u_end - u - 1); -} -#else -static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) -{ - const Py_UNICODE *u_end = u; - while (*u_end++) ; - return (size_t)(u_end - u - 1); -} -#endif #define __Pyx_PyUnicode_FromOrdinal(o) PyUnicode_FromOrdinal((int)o) -#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) -#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) @@ -1332,7 +1383,7 @@ static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*); #endif typedef Py_ssize_t __Pyx_compact_pylong; typedef size_t __Pyx_compact_upylong; - #else // Py < 3.12 + #else #define __Pyx_PyLong_IsNeg(x) (Py_SIZE(x) < 0) #define __Pyx_PyLong_IsNonNeg(x) (Py_SIZE(x) >= 0) #define __Pyx_PyLong_IsZero(x) (Py_SIZE(x) == 0) @@ -1452,7 +1503,7 @@ static const char *__pyx_filename; #if !defined(CYTHON_CCOMPLEX) #if defined(__cplusplus) #define CYTHON_CCOMPLEX 1 - #elif (defined(_Complex_I) && !defined(_MSC_VER)) || ((defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) && !defined(__STDC_NO_COMPLEX__)) + #elif (defined(_Complex_I) && !defined(_MSC_VER)) || ((defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) && !defined(__STDC_NO_COMPLEX__) && !defined(_MSC_VER)) #define CYTHON_CCOMPLEX 1 #else #define CYTHON_CCOMPLEX 0 @@ -1473,7 +1524,7 @@ static const char *__pyx_filename; /* #### Code section: filename_table ### */ static const char *__pyx_f[] = { - "nufft.pyx", + "src/fastkde/nufft.pyx", "", "__init__.cython-30.pxd", "type.pxd", @@ -1622,7 +1673,7 @@ typedef struct { /* #### Code section: numeric_typedefs ### */ -/* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":730 +/* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":769 * # in Cython to enable them only on the right systems. * * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<< @@ -1631,7 +1682,7 @@ typedef struct { */ typedef npy_int8 __pyx_t_5numpy_int8_t; -/* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":731 +/* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":770 * * ctypedef npy_int8 int8_t * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<< @@ -1640,7 +1691,7 @@ typedef npy_int8 __pyx_t_5numpy_int8_t; */ typedef npy_int16 __pyx_t_5numpy_int16_t; -/* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":732 +/* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":771 * ctypedef npy_int8 int8_t * ctypedef npy_int16 int16_t * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<< @@ -1649,7 +1700,7 @@ typedef npy_int16 __pyx_t_5numpy_int16_t; */ typedef npy_int32 __pyx_t_5numpy_int32_t; -/* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":733 +/* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":772 * ctypedef npy_int16 int16_t * ctypedef npy_int32 int32_t * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<< @@ -1658,7 +1709,7 @@ typedef npy_int32 __pyx_t_5numpy_int32_t; */ typedef npy_int64 __pyx_t_5numpy_int64_t; -/* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":737 +/* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":776 * #ctypedef npy_int128 int128_t * * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<< @@ -1667,7 +1718,7 @@ typedef npy_int64 __pyx_t_5numpy_int64_t; */ typedef npy_uint8 __pyx_t_5numpy_uint8_t; -/* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":738 +/* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":777 * * ctypedef npy_uint8 uint8_t * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<< @@ -1676,7 +1727,7 @@ typedef npy_uint8 __pyx_t_5numpy_uint8_t; */ typedef npy_uint16 __pyx_t_5numpy_uint16_t; -/* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":739 +/* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":778 * ctypedef npy_uint8 uint8_t * ctypedef npy_uint16 uint16_t * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<< @@ -1685,7 +1736,7 @@ typedef npy_uint16 __pyx_t_5numpy_uint16_t; */ typedef npy_uint32 __pyx_t_5numpy_uint32_t; -/* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":740 +/* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":779 * ctypedef npy_uint16 uint16_t * ctypedef npy_uint32 uint32_t * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<< @@ -1694,7 +1745,7 @@ typedef npy_uint32 __pyx_t_5numpy_uint32_t; */ typedef npy_uint64 __pyx_t_5numpy_uint64_t; -/* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":744 +/* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":783 * #ctypedef npy_uint128 uint128_t * * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<< @@ -1703,7 +1754,7 @@ typedef npy_uint64 __pyx_t_5numpy_uint64_t; */ typedef npy_float32 __pyx_t_5numpy_float32_t; -/* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":745 +/* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":784 * * ctypedef npy_float32 float32_t * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<< @@ -1712,43 +1763,25 @@ typedef npy_float32 __pyx_t_5numpy_float32_t; */ typedef npy_float64 __pyx_t_5numpy_float64_t; -/* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":754 - * # The int types are mapped a bit surprising -- - * # numpy.int corresponds to 'l' and numpy.long to 'q' - * ctypedef npy_long int_t # <<<<<<<<<<<<<< - * ctypedef npy_longlong longlong_t +/* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":791 + * ctypedef double complex complex128_t * - */ -typedef npy_long __pyx_t_5numpy_int_t; - -/* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":755 - * # numpy.int corresponds to 'l' and numpy.long to 'q' - * ctypedef npy_long int_t * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<< - * - * ctypedef npy_ulong uint_t - */ -typedef npy_longlong __pyx_t_5numpy_longlong_t; - -/* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":757 - * ctypedef npy_longlong longlong_t - * - * ctypedef npy_ulong uint_t # <<<<<<<<<<<<<< * ctypedef npy_ulonglong ulonglong_t * */ -typedef npy_ulong __pyx_t_5numpy_uint_t; +typedef npy_longlong __pyx_t_5numpy_longlong_t; -/* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":758 +/* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":792 * - * ctypedef npy_ulong uint_t + * ctypedef npy_longlong longlong_t * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<< * * ctypedef npy_intp intp_t */ typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t; -/* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":760 +/* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":794 * ctypedef npy_ulonglong ulonglong_t * * ctypedef npy_intp intp_t # <<<<<<<<<<<<<< @@ -1757,7 +1790,7 @@ typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t; */ typedef npy_intp __pyx_t_5numpy_intp_t; -/* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":761 +/* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":795 * * ctypedef npy_intp intp_t * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<< @@ -1766,7 +1799,7 @@ typedef npy_intp __pyx_t_5numpy_intp_t; */ typedef npy_uintp __pyx_t_5numpy_uintp_t; -/* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":763 +/* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":797 * ctypedef npy_uintp uintp_t * * ctypedef npy_double float_t # <<<<<<<<<<<<<< @@ -1775,7 +1808,7 @@ typedef npy_uintp __pyx_t_5numpy_uintp_t; */ typedef npy_double __pyx_t_5numpy_float_t; -/* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":764 +/* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":798 * * ctypedef npy_double float_t * ctypedef npy_double double_t # <<<<<<<<<<<<<< @@ -1784,12 +1817,12 @@ typedef npy_double __pyx_t_5numpy_float_t; */ typedef npy_double __pyx_t_5numpy_double_t; -/* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":765 +/* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":799 * ctypedef npy_double float_t * ctypedef npy_double double_t * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<< * - * ctypedef npy_cfloat cfloat_t + * ctypedef float complex cfloat_t */ typedef npy_longdouble __pyx_t_5numpy_longdouble_t; /* #### Code section: complex_type_declarations ### */ @@ -1817,6 +1850,18 @@ static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(do #endif static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float); +/* Declarations.proto */ +#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus) + #ifdef __cplusplus + typedef ::std::complex< long double > __pyx_t_long_double_complex; + #else + typedef long double _Complex __pyx_t_long_double_complex; + #endif +#else + typedef struct { long double real, imag; } __pyx_t_long_double_complex; +#endif +static CYTHON_INLINE __pyx_t_long_double_complex __pyx_t_long_double_complex_from_parts(long double, long double); + /* #### Code section: type_declarations ### */ /*--- Type declarations ---*/ @@ -1825,41 +1870,23 @@ struct __pyx_MemviewEnum_obj; struct __pyx_memoryview_obj; struct __pyx_memoryviewslice_obj; -/* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":767 - * ctypedef npy_longdouble longdouble_t +/* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1095 * - * ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<< - * ctypedef npy_cdouble cdouble_t - * ctypedef npy_clongdouble clongdouble_t - */ -typedef npy_cfloat __pyx_t_5numpy_cfloat_t; - -/* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":768 - * - * ctypedef npy_cfloat cfloat_t - * ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<< - * ctypedef npy_clongdouble clongdouble_t + * # Iterator API added in v1.6 + * ctypedef int (*NpyIter_IterNextFunc)(NpyIter* it) noexcept nogil # <<<<<<<<<<<<<< + * ctypedef void (*NpyIter_GetMultiIndexFunc)(NpyIter* it, npy_intp* outcoords) noexcept nogil * */ -typedef npy_cdouble __pyx_t_5numpy_cdouble_t; +typedef int (*__pyx_t_5numpy_NpyIter_IterNextFunc)(NpyIter *); -/* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":769 - * ctypedef npy_cfloat cfloat_t - * ctypedef npy_cdouble cdouble_t - * ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<< - * - * ctypedef npy_cdouble complex_t - */ -typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t; - -/* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":771 - * ctypedef npy_clongdouble clongdouble_t - * - * ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<< +/* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1096 + * # Iterator API added in v1.6 + * ctypedef int (*NpyIter_IterNextFunc)(NpyIter* it) noexcept nogil + * ctypedef void (*NpyIter_GetMultiIndexFunc)(NpyIter* it, npy_intp* outcoords) noexcept nogil # <<<<<<<<<<<<<< * - * cdef inline object PyArray_MultiIterNew1(a): + * cdef extern from "numpy/arrayobject.h": */ -typedef npy_cdouble __pyx_t_5numpy_complex_t; +typedef void (*__pyx_t_5numpy_NpyIter_GetMultiIndexFunc)(NpyIter *, npy_intp *); struct __pyx_opt_args_7fastkde_5nufft_nuifft; struct __pyx_opt_args_7fastkde_5nufft_idft; struct __pyx_opt_args_7fastkde_5nufft_dft_points; @@ -2201,8 +2228,8 @@ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int #define __Pyx_Arg_NewRef_VARARGS(arg) __Pyx_NewRef(arg) #define __Pyx_Arg_XDECREF_VARARGS(arg) Py_XDECREF(arg) #else - #define __Pyx_Arg_NewRef_VARARGS(arg) arg // no-op - #define __Pyx_Arg_XDECREF_VARARGS(arg) // no-op - arg is borrowed + #define __Pyx_Arg_NewRef_VARARGS(arg) arg + #define __Pyx_Arg_XDECREF_VARARGS(arg) #endif #define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds) #define __Pyx_KwValues_VARARGS(args, nargs) NULL @@ -2213,9 +2240,14 @@ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int #define __Pyx_NumKwargs_FASTCALL(kwds) PyTuple_GET_SIZE(kwds) #define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs)) static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s); +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 + CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues); + #else #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw) - #define __Pyx_Arg_NewRef_FASTCALL(arg) arg // no-op, __Pyx_Arg_FASTCALL is direct and this needs - #define __Pyx_Arg_XDECREF_FASTCALL(arg) // no-op - arg was returned from array + #endif + #define __Pyx_Arg_NewRef_FASTCALL(arg) arg /* no-op, __Pyx_Arg_FASTCALL is direct and this needs + to have the same reference counting */ + #define __Pyx_Arg_XDECREF_FASTCALL(arg) #else #define __Pyx_Arg_FASTCALL __Pyx_Arg_VARARGS #define __Pyx_NumKwargs_FASTCALL __Pyx_NumKwargs_VARARGS @@ -2563,7 +2595,11 @@ static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) { Py_ssize_t len = Py_SIZE(list); if (likely(L->allocated > len)) { Py_INCREF(x); + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 + L->ob_item[len] = x; + #else PyList_SET_ITEM(list, len, x); + #endif __Pyx_SET_SIZE(list, len + 1); return 0; } @@ -2608,8 +2644,8 @@ static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *); /* ErrOccurredWithGIL.proto */ static CYTHON_INLINE int __Pyx_ErrOccurredWithGIL(void); -/* DivInt[__pyx_t_5numpy_int_t].proto */ -static CYTHON_INLINE __pyx_t_5numpy_int_t __Pyx_div___pyx_t_5numpy_int_t(__pyx_t_5numpy_int_t, __pyx_t_5numpy_int_t); +/* DivInt[__pyx_t_5numpy_int64_t].proto */ +static CYTHON_INLINE __pyx_t_5numpy_int64_t __Pyx_div___pyx_t_5numpy_int64_t(__pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t); /* PyIntBinop.proto */ #if !CYTHON_COMPILING_IN_PYPY @@ -2675,22 +2711,22 @@ static int __Pyx_setup_reduce(PyObject* type_obj); #endif /* TypeImport.proto */ -#ifndef __PYX_HAVE_RT_ImportType_proto_3_0_3 -#define __PYX_HAVE_RT_ImportType_proto_3_0_3 +#ifndef __PYX_HAVE_RT_ImportType_proto_3_0_11 +#define __PYX_HAVE_RT_ImportType_proto_3_0_11 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L #include #endif #if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) || __cplusplus >= 201103L -#define __PYX_GET_STRUCT_ALIGNMENT_3_0_3(s) alignof(s) +#define __PYX_GET_STRUCT_ALIGNMENT_3_0_11(s) alignof(s) #else -#define __PYX_GET_STRUCT_ALIGNMENT_3_0_3(s) sizeof(void*) +#define __PYX_GET_STRUCT_ALIGNMENT_3_0_11(s) sizeof(void*) #endif -enum __Pyx_ImportType_CheckSize_3_0_3 { - __Pyx_ImportType_CheckSize_Error_3_0_3 = 0, - __Pyx_ImportType_CheckSize_Warn_3_0_3 = 1, - __Pyx_ImportType_CheckSize_Ignore_3_0_3 = 2 +enum __Pyx_ImportType_CheckSize_3_0_11 { + __Pyx_ImportType_CheckSize_Error_3_0_11 = 0, + __Pyx_ImportType_CheckSize_Warn_3_0_11 = 1, + __Pyx_ImportType_CheckSize_Ignore_3_0_11 = 2 }; -static PyTypeObject *__Pyx_ImportType_3_0_3(PyObject* module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_3 check_size); +static PyTypeObject *__Pyx_ImportType_3_0_11(PyObject* module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_11 check_size); #endif /* ImportDottedModuleRelFirst.proto */ @@ -2786,7 +2822,7 @@ typedef struct { #endif void *defaults; int defaults_pyobjects; - size_t defaults_size; // used by FusedFunction for copying defaults + size_t defaults_size; int flags; PyObject *defaults_tuple; PyObject *defaults_kwdict; @@ -3001,11 +3037,11 @@ static CYTHON_INLINE PyObject *__pyx_memview_get___pyx_t_double_complex(const ch static CYTHON_INLINE int __pyx_memview_set___pyx_t_double_complex(const char *itemp, PyObject *obj); /* ObjectToMemviewSlice.proto */ -static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int_t(PyObject *, int writable_flag); +static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(PyObject *, int writable_flag); /* MemviewDtypeToObject.proto */ -static CYTHON_INLINE PyObject *__pyx_memview_get_nn___pyx_t_5numpy_int_t(const char *itemp); -static CYTHON_INLINE int __pyx_memview_set_nn___pyx_t_5numpy_int_t(const char *itemp, PyObject *obj); +static CYTHON_INLINE PyObject *__pyx_memview_get_nn___pyx_t_5numpy_int64_t(const char *itemp); +static CYTHON_INLINE int __pyx_memview_set_nn___pyx_t_5numpy_int64_t(const char *itemp, PyObject *obj); /* IntPow.proto */ static CYTHON_INLINE long __Pyx_pow_long(long, long); @@ -3058,6 +3094,44 @@ static PyObject* __pyx_print_kwargs = 0; #endif #endif +/* Arithmetic.proto */ +#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus) + #define __Pyx_c_eq_long__double(a, b) ((a)==(b)) + #define __Pyx_c_sum_long__double(a, b) ((a)+(b)) + #define __Pyx_c_diff_long__double(a, b) ((a)-(b)) + #define __Pyx_c_prod_long__double(a, b) ((a)*(b)) + #define __Pyx_c_quot_long__double(a, b) ((a)/(b)) + #define __Pyx_c_neg_long__double(a) (-(a)) + #ifdef __cplusplus + #define __Pyx_c_is_zero_long__double(z) ((z)==(long double)0) + #define __Pyx_c_conj_long__double(z) (::std::conj(z)) + #if 1 + #define __Pyx_c_abs_long__double(z) (::std::abs(z)) + #define __Pyx_c_pow_long__double(a, b) (::std::pow(a, b)) + #endif + #else + #define __Pyx_c_is_zero_long__double(z) ((z)==0) + #define __Pyx_c_conj_long__double(z) (conjl(z)) + #if 1 + #define __Pyx_c_abs_long__double(z) (cabsl(z)) + #define __Pyx_c_pow_long__double(a, b) (cpowl(a, b)) + #endif + #endif +#else + static CYTHON_INLINE int __Pyx_c_eq_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex); + static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_sum_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex); + static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_diff_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex); + static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_prod_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex); + static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_quot_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex); + static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_neg_long__double(__pyx_t_long_double_complex); + static CYTHON_INLINE int __Pyx_c_is_zero_long__double(__pyx_t_long_double_complex); + static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_conj_long__double(__pyx_t_long_double_complex); + #if 1 + static CYTHON_INLINE long double __Pyx_c_abs_long__double(__pyx_t_long_double_complex); + static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_pow_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex); + #endif +#endif + /* MemviewSliceCopyTemplate.proto */ static __Pyx_memviewslice __pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs, @@ -3100,10 +3174,10 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); /* CIntFromPy.proto */ -static CYTHON_INLINE npy_long __Pyx_PyInt_As_npy_long(PyObject *); +static CYTHON_INLINE npy_int64 __Pyx_PyInt_As_npy_int64(PyObject *); /* CIntToPy.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_long(npy_long value); +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int64(npy_int64 value); /* PrintOne.proto */ static int __Pyx_PrintOne(PyObject* stream, PyObject *o); @@ -3128,7 +3202,7 @@ typedef const char *__Pyx_TypeName; #endif /* CheckBinaryVersion.proto */ -static unsigned long __Pyx_get_runtime_version(); +static unsigned long __Pyx_get_runtime_version(void); static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer); /* InitStrings.proto */ @@ -3147,6 +3221,18 @@ static PyObject *__pyx_memoryview__get_base(struct __pyx_memoryview_obj *__pyx_v static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/ static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/ static PyObject *__pyx_memoryviewslice__get_base(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto*/ +static CYTHON_INLINE npy_intp __pyx_f_5numpy_5dtype_8itemsize_itemsize(PyArray_Descr *__pyx_v_self); /* proto*/ +static CYTHON_INLINE npy_intp __pyx_f_5numpy_5dtype_9alignment_alignment(PyArray_Descr *__pyx_v_self); /* proto*/ +static CYTHON_INLINE PyObject *__pyx_f_5numpy_5dtype_6fields_fields(PyArray_Descr *__pyx_v_self); /* proto*/ +static CYTHON_INLINE PyObject *__pyx_f_5numpy_5dtype_5names_names(PyArray_Descr *__pyx_v_self); /* proto*/ +static CYTHON_INLINE PyArray_ArrayDescr *__pyx_f_5numpy_5dtype_8subarray_subarray(PyArray_Descr *__pyx_v_self); /* proto*/ +static CYTHON_INLINE npy_uint64 __pyx_f_5numpy_5dtype_5flags_flags(PyArray_Descr *__pyx_v_self); /* proto*/ +static CYTHON_INLINE int __pyx_f_5numpy_9broadcast_7numiter_numiter(PyArrayMultiIterObject *__pyx_v_self); /* proto*/ +static CYTHON_INLINE npy_intp __pyx_f_5numpy_9broadcast_4size_size(PyArrayMultiIterObject *__pyx_v_self); /* proto*/ +static CYTHON_INLINE npy_intp __pyx_f_5numpy_9broadcast_5index_index(PyArrayMultiIterObject *__pyx_v_self); /* proto*/ +static CYTHON_INLINE int __pyx_f_5numpy_9broadcast_2nd_nd(PyArrayMultiIterObject *__pyx_v_self); /* proto*/ +static CYTHON_INLINE npy_intp *__pyx_f_5numpy_9broadcast_10dimensions_dimensions(PyArrayMultiIterObject *__pyx_v_self); /* proto*/ +static CYTHON_INLINE void **__pyx_f_5numpy_9broadcast_5iters_iters(PyArrayMultiIterObject *__pyx_v_self); /* proto*/ static CYTHON_INLINE PyObject *__pyx_f_5numpy_7ndarray_4base_base(PyArrayObject *__pyx_v_self); /* proto*/ static CYTHON_INLINE PyArray_Descr *__pyx_f_5numpy_7ndarray_5descr_descr(PyArrayObject *__pyx_v_self); /* proto*/ static CYTHON_INLINE int __pyx_f_5numpy_7ndarray_4ndim_ndim(PyArrayObject *__pyx_v_self); /* proto*/ @@ -3191,8 +3277,8 @@ static PyThread_type_lock __pyx_memoryview_thread_locks[8]; static __pyx_t_double_complex __pyx_f_7fastkde_5nufft_cexp(__pyx_t_double_complex); /*proto*/ static PyArrayObject *__pyx_f_7fastkde_5nufft_nuifft(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, int __pyx_skip_dispatch, struct __pyx_opt_args_7fastkde_5nufft_nuifft *__pyx_optional_args); /*proto*/ static PyArrayObject *__pyx_f_7fastkde_5nufft_idft(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, int __pyx_skip_dispatch, struct __pyx_opt_args_7fastkde_5nufft_idft *__pyx_optional_args); /*proto*/ -static CYTHON_INLINE int __pyx_f_7fastkde_5nufft_unravelIndex(__pyx_t_5numpy_int_t, __Pyx_memviewslice, __Pyx_memviewslice, __pyx_t_5numpy_int_t); /*proto*/ -static CYTHON_INLINE int __pyx_f_7fastkde_5nufft_ravelIndex(__Pyx_memviewslice, __Pyx_memviewslice, __pyx_t_5numpy_int_t); /*proto*/ +static CYTHON_INLINE int __pyx_f_7fastkde_5nufft_unravelIndex(__pyx_t_5numpy_int64_t, __Pyx_memviewslice, __Pyx_memviewslice, __pyx_t_5numpy_int64_t); /*proto*/ +static CYTHON_INLINE int __pyx_f_7fastkde_5nufft_ravelIndex(__Pyx_memviewslice, __Pyx_memviewslice, __pyx_t_5numpy_int64_t); /*proto*/ static PyArrayObject *__pyx_f_7fastkde_5nufft_dft_points(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, int __pyx_skip_dispatch, struct __pyx_opt_args_7fastkde_5nufft_dft_points *__pyx_optional_args); /*proto*/ static int __pyx_array_allocate_buffer(struct __pyx_array_obj *); /*proto*/ static struct __pyx_array_obj *__pyx_array_new(PyObject *, Py_ssize_t, char *, char *, char *); /*proto*/ @@ -3231,7 +3317,7 @@ static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *, /* #### Code section: typeinfo ### */ static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_float_t = { "float_t", NULL, sizeof(__pyx_t_5numpy_float_t), { 0 }, 0, 'R', 0, 0 }; static __Pyx_TypeInfo __Pyx_TypeInfo___pyx_t_double_complex = { "double complex", NULL, sizeof(__pyx_t_double_complex), { 0 }, 0, 'C', 0, 0 }; -static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_int_t = { "int_t", NULL, sizeof(__pyx_t_5numpy_int_t), { 0 }, 0, __PYX_IS_UNSIGNED(__pyx_t_5numpy_int_t) ? 'U' : 'I', __PYX_IS_UNSIGNED(__pyx_t_5numpy_int_t), 0 }; +static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t = { "int64_t", NULL, sizeof(__pyx_t_5numpy_int64_t), { 0 }, 0, __PYX_IS_UNSIGNED(__pyx_t_5numpy_int64_t) ? 'U' : 'I', __PYX_IS_UNSIGNED(__pyx_t_5numpy_int64_t), 0 }; /* #### Code section: before_global_var ### */ #define __Pyx_MODULE_NAME "fastkde.nufft" extern int __pyx_module_is_main_fastkde__nufft; @@ -3340,7 +3426,6 @@ static const char __pyx_k_abscissas[] = "abscissas"; static const char __pyx_k_enumerate[] = "enumerate"; static const char __pyx_k_ifftshift[] = "ifftshift"; static const char __pyx_k_isenabled[] = "isenabled"; -static const char __pyx_k_nufft_pyx[] = "nufft.pyx"; static const char __pyx_k_numpy_fft[] = "numpy.fft"; static const char __pyx_k_ordinates[] = "ordinates"; static const char __pyx_k_precision[] = "precision"; @@ -3387,6 +3472,7 @@ static const char __pyx_k_Calculating_the_DFT[] = "Calculating the DFT"; static const char __pyx_k_strided_and_indirect[] = ""; static const char __pyx_k_Invalid_shape_in_axis[] = "Invalid shape in axis "; static const char __pyx_k_contiguous_and_direct[] = ""; +static const char __pyx_k_src_fastkde_nufft_pyx[] = "src/fastkde/nufft.pyx"; static const char __pyx_k_Cannot_index_with_type[] = "Cannot index with type '"; static const char __pyx_k_MemoryView_of_r_object[] = ""; static const char __pyx_k_MemoryView_of_r_at_0x_x[] = ""; @@ -3403,7 +3489,6 @@ static const char __pyx_k_Creating_the_convolution_grid[] = "Creating the convol static const char __pyx_k_unable_to_allocate_array_data[] = "unable to allocate array data."; static const char __pyx_k_Initializing_the_deconvolution[] = "Initializing the deconvolution"; static const char __pyx_k_strided_and_direct_or_indirect[] = ""; -static const char __pyx_k_numpy_core_multiarray_failed_to[] = "numpy.core.multiarray failed to import"; static const char __pyx_k_All_dimensions_preceding_dimensi[] = "All dimensions preceding dimension %d must be indexed and not sliced"; static const char __pyx_k_Buffer_view_does_not_expose_stri[] = "Buffer view does not expose strides"; static const char __pyx_k_Can_only_create_a_buffer_that_is[] = "Can only create a buffer that is contiguous in memory."; @@ -3430,7 +3515,8 @@ static const char __pyx_k_Some_frequencies_in_frequency_gr[] = "Some frequencies static const char __pyx_k_Unable_to_convert_item_to_object[] = "Unable to convert item to object"; static const char __pyx_k_got_differing_extents_in_dimensi[] = "got differing extents in dimension "; static const char __pyx_k_no_default___reduce___due_to_non[] = "no default __reduce__ due to non-trivial __cinit__"; -static const char __pyx_k_numpy_core_umath_failed_to_impor[] = "numpy.core.umath failed to import"; +static const char __pyx_k_numpy__core_multiarray_failed_to[] = "numpy._core.multiarray failed to import"; +static const char __pyx_k_numpy__core_umath_failed_to_impo[] = "numpy._core.umath failed to import"; static const char __pyx_k_unable_to_allocate_shape_and_str[] = "unable to allocate shape and strides."; /* #### Code section: decls ### */ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode, int __pyx_v_allocate_buffer); /* proto */ @@ -3689,11 +3775,10 @@ typedef struct { PyObject *__pyx_n_s_new; PyObject *__pyx_kp_s_no_default___reduce___due_to_non; PyObject *__pyx_n_s_np; - PyObject *__pyx_kp_s_nufft_pyx; PyObject *__pyx_n_s_nuifft; PyObject *__pyx_n_s_numpy; - PyObject *__pyx_kp_s_numpy_core_multiarray_failed_to; - PyObject *__pyx_kp_s_numpy_core_umath_failed_to_impor; + PyObject *__pyx_kp_s_numpy__core_multiarray_failed_to; + PyObject *__pyx_kp_s_numpy__core_umath_failed_to_impo; PyObject *__pyx_n_s_numpy_fft; PyObject *__pyx_n_s_obj; PyObject *__pyx_n_s_ones; @@ -3725,6 +3810,7 @@ typedef struct { PyObject *__pyx_kp_s_shape_convolvedFFT; PyObject *__pyx_n_s_size; PyObject *__pyx_n_s_spec; + PyObject *__pyx_kp_s_src_fastkde_nufft_pyx; PyObject *__pyx_n_s_start; PyObject *__pyx_n_s_step; PyObject *__pyx_n_s_stop; @@ -3986,11 +4072,10 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_n_s_new); Py_CLEAR(clear_module_state->__pyx_kp_s_no_default___reduce___due_to_non); Py_CLEAR(clear_module_state->__pyx_n_s_np); - Py_CLEAR(clear_module_state->__pyx_kp_s_nufft_pyx); Py_CLEAR(clear_module_state->__pyx_n_s_nuifft); Py_CLEAR(clear_module_state->__pyx_n_s_numpy); - Py_CLEAR(clear_module_state->__pyx_kp_s_numpy_core_multiarray_failed_to); - Py_CLEAR(clear_module_state->__pyx_kp_s_numpy_core_umath_failed_to_impor); + Py_CLEAR(clear_module_state->__pyx_kp_s_numpy__core_multiarray_failed_to); + Py_CLEAR(clear_module_state->__pyx_kp_s_numpy__core_umath_failed_to_impo); Py_CLEAR(clear_module_state->__pyx_n_s_numpy_fft); Py_CLEAR(clear_module_state->__pyx_n_s_obj); Py_CLEAR(clear_module_state->__pyx_n_s_ones); @@ -4022,6 +4107,7 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_kp_s_shape_convolvedFFT); Py_CLEAR(clear_module_state->__pyx_n_s_size); Py_CLEAR(clear_module_state->__pyx_n_s_spec); + Py_CLEAR(clear_module_state->__pyx_kp_s_src_fastkde_nufft_pyx); Py_CLEAR(clear_module_state->__pyx_n_s_start); Py_CLEAR(clear_module_state->__pyx_n_s_step); Py_CLEAR(clear_module_state->__pyx_n_s_stop); @@ -4258,11 +4344,10 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_n_s_new); Py_VISIT(traverse_module_state->__pyx_kp_s_no_default___reduce___due_to_non); Py_VISIT(traverse_module_state->__pyx_n_s_np); - Py_VISIT(traverse_module_state->__pyx_kp_s_nufft_pyx); Py_VISIT(traverse_module_state->__pyx_n_s_nuifft); Py_VISIT(traverse_module_state->__pyx_n_s_numpy); - Py_VISIT(traverse_module_state->__pyx_kp_s_numpy_core_multiarray_failed_to); - Py_VISIT(traverse_module_state->__pyx_kp_s_numpy_core_umath_failed_to_impor); + Py_VISIT(traverse_module_state->__pyx_kp_s_numpy__core_multiarray_failed_to); + Py_VISIT(traverse_module_state->__pyx_kp_s_numpy__core_umath_failed_to_impo); Py_VISIT(traverse_module_state->__pyx_n_s_numpy_fft); Py_VISIT(traverse_module_state->__pyx_n_s_obj); Py_VISIT(traverse_module_state->__pyx_n_s_ones); @@ -4294,6 +4379,7 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_kp_s_shape_convolvedFFT); Py_VISIT(traverse_module_state->__pyx_n_s_size); Py_VISIT(traverse_module_state->__pyx_n_s_spec); + Py_VISIT(traverse_module_state->__pyx_kp_s_src_fastkde_nufft_pyx); Py_VISIT(traverse_module_state->__pyx_n_s_start); Py_VISIT(traverse_module_state->__pyx_n_s_step); Py_VISIT(traverse_module_state->__pyx_n_s_stop); @@ -4564,11 +4650,10 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_n_s_new __pyx_mstate_global->__pyx_n_s_new #define __pyx_kp_s_no_default___reduce___due_to_non __pyx_mstate_global->__pyx_kp_s_no_default___reduce___due_to_non #define __pyx_n_s_np __pyx_mstate_global->__pyx_n_s_np -#define __pyx_kp_s_nufft_pyx __pyx_mstate_global->__pyx_kp_s_nufft_pyx #define __pyx_n_s_nuifft __pyx_mstate_global->__pyx_n_s_nuifft #define __pyx_n_s_numpy __pyx_mstate_global->__pyx_n_s_numpy -#define __pyx_kp_s_numpy_core_multiarray_failed_to __pyx_mstate_global->__pyx_kp_s_numpy_core_multiarray_failed_to -#define __pyx_kp_s_numpy_core_umath_failed_to_impor __pyx_mstate_global->__pyx_kp_s_numpy_core_umath_failed_to_impor +#define __pyx_kp_s_numpy__core_multiarray_failed_to __pyx_mstate_global->__pyx_kp_s_numpy__core_multiarray_failed_to +#define __pyx_kp_s_numpy__core_umath_failed_to_impo __pyx_mstate_global->__pyx_kp_s_numpy__core_umath_failed_to_impo #define __pyx_n_s_numpy_fft __pyx_mstate_global->__pyx_n_s_numpy_fft #define __pyx_n_s_obj __pyx_mstate_global->__pyx_n_s_obj #define __pyx_n_s_ones __pyx_mstate_global->__pyx_n_s_ones @@ -4600,6 +4685,7 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_kp_s_shape_convolvedFFT __pyx_mstate_global->__pyx_kp_s_shape_convolvedFFT #define __pyx_n_s_size __pyx_mstate_global->__pyx_n_s_size #define __pyx_n_s_spec __pyx_mstate_global->__pyx_n_s_spec +#define __pyx_kp_s_src_fastkde_nufft_pyx __pyx_mstate_global->__pyx_kp_s_src_fastkde_nufft_pyx #define __pyx_n_s_start __pyx_mstate_global->__pyx_n_s_start #define __pyx_n_s_step __pyx_mstate_global->__pyx_n_s_step #define __pyx_n_s_stop __pyx_mstate_global->__pyx_n_s_stop @@ -4855,10 +4941,11 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; - int __pyx_t_7; + unsigned int __pyx_t_7; char *__pyx_t_8; - Py_ssize_t __pyx_t_9; - Py_UCS4 __pyx_t_10; + int __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_UCS4 __pyx_t_11; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; @@ -5084,7 +5171,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ * if dim <= 0: * raise ValueError, f"Invalid shape in axis {idx}: {dim}." */ - __pyx_t_7 = 0; + __pyx_t_9 = 0; __pyx_t_4 = __pyx_v_shape; __Pyx_INCREF(__pyx_t_4); __pyx_t_1 = 0; for (;;) { @@ -5101,11 +5188,11 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif - __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 159, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 159, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_v_dim = __pyx_t_9; - __pyx_v_idx = __pyx_t_7; - __pyx_t_7 = (__pyx_t_7 + 1); + __pyx_v_dim = __pyx_t_10; + __pyx_v_idx = __pyx_t_9; + __pyx_t_9 = (__pyx_t_9 + 1); /* "View.MemoryView":160 * @@ -5126,33 +5213,33 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ */ __pyx_t_5 = PyTuple_New(5); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 161, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_9 = 0; - __pyx_t_10 = 127; + __pyx_t_10 = 0; + __pyx_t_11 = 127; __Pyx_INCREF(__pyx_kp_u_Invalid_shape_in_axis); - __pyx_t_9 += 22; + __pyx_t_10 += 22; __Pyx_GIVEREF(__pyx_kp_u_Invalid_shape_in_axis); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_kp_u_Invalid_shape_in_axis); __pyx_t_6 = __Pyx_PyUnicode_From_int(__pyx_v_idx, 0, ' ', 'd'); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 161, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_9 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6); + __pyx_t_10 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_6); __pyx_t_6 = 0; __Pyx_INCREF(__pyx_kp_u_); - __pyx_t_9 += 2; + __pyx_t_10 += 2; __Pyx_GIVEREF(__pyx_kp_u_); PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_kp_u_); __pyx_t_6 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_v_dim, 0, ' ', 'd'); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 161, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_9 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6); + __pyx_t_10 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_6); __pyx_t_6 = 0; __Pyx_INCREF(__pyx_kp_u__2); - __pyx_t_9 += 1; + __pyx_t_10 += 1; __Pyx_GIVEREF(__pyx_kp_u__2); PyTuple_SET_ITEM(__pyx_t_5, 4, __pyx_kp_u__2); - __pyx_t_6 = __Pyx_PyUnicode_Join(__pyx_t_5, 5, __pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 161, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyUnicode_Join(__pyx_t_5, 5, __pyx_t_10, __pyx_t_11); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 161, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_builtin_ValueError, __pyx_t_6, 0, 0); @@ -5336,7 +5423,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ * * @cname('getbuffer') */ - __pyx_t_7 = __pyx_array_allocate_buffer(__pyx_v_self); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(1, 180, __pyx_L1_error) + __pyx_t_9 = __pyx_array_allocate_buffer(__pyx_v_self); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 180, __pyx_L1_error) /* "View.MemoryView":179 * self.dtype_is_object = format == b'O' @@ -8491,7 +8578,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setit * * if have_slices: # <<<<<<<<<<<<<< * obj = self.is_slice(value) - * if obj: + * if obj is not None: */ __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(1, 426, __pyx_L1_error) if (__pyx_t_4) { @@ -8500,7 +8587,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setit * * if have_slices: * obj = self.is_slice(value) # <<<<<<<<<<<<<< - * if obj: + * if obj is not None: * self.setitem_slice_assignment(self[index], obj) */ __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->is_slice(__pyx_v_self, __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 427, __pyx_L1_error) @@ -8511,16 +8598,16 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setit /* "View.MemoryView":428 * if have_slices: * obj = self.is_slice(value) - * if obj: # <<<<<<<<<<<<<< + * if obj is not None: # <<<<<<<<<<<<<< * self.setitem_slice_assignment(self[index], obj) * else: */ - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_obj); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(1, 428, __pyx_L1_error) + __pyx_t_4 = (__pyx_v_obj != Py_None); if (__pyx_t_4) { /* "View.MemoryView":429 * obj = self.is_slice(value) - * if obj: + * if obj is not None: * self.setitem_slice_assignment(self[index], obj) # <<<<<<<<<<<<<< * else: * self.setitem_slice_assign_scalar(self[index], value) @@ -8535,7 +8622,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setit /* "View.MemoryView":428 * if have_slices: * obj = self.is_slice(value) - * if obj: # <<<<<<<<<<<<<< + * if obj is not None: # <<<<<<<<<<<<<< * self.setitem_slice_assignment(self[index], obj) * else: */ @@ -8565,7 +8652,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setit * * if have_slices: # <<<<<<<<<<<<<< * obj = self.is_slice(value) - * if obj: + * if obj is not None: */ goto __pyx_L4; } @@ -9273,9 +9360,10 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; - int __pyx_t_8; + unsigned int __pyx_t_8; Py_ssize_t __pyx_t_9; int __pyx_t_10; + int __pyx_t_11; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; @@ -9430,11 +9518,11 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview __Pyx_ErrFetch(&__pyx_t_1, &__pyx_t_5, &__pyx_t_6); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_error); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 498, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_1, __pyx_t_7); + __pyx_t_11 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_1, __pyx_t_7); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_ErrRestore(__pyx_t_1, __pyx_t_5, __pyx_t_6); __pyx_t_1 = 0; __pyx_t_5 = 0; __pyx_t_6 = 0; - if (__pyx_t_8) { + if (__pyx_t_11) { __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_5, &__pyx_t_1) < 0) __PYX_ERR(1, 498, __pyx_L5_except_error) __Pyx_XGOTREF(__pyx_t_6); @@ -9519,7 +9607,7 @@ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryvie PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; - int __pyx_t_6; + unsigned int __pyx_t_6; Py_ssize_t __pyx_t_7; PyObject *__pyx_t_8 = NULL; char *__pyx_t_9; @@ -17993,7 +18081,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSE int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; - int __pyx_t_5; + unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; @@ -18175,7 +18263,7 @@ static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *__ PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; - int __pyx_t_8; + unsigned int __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; @@ -18295,10 +18383,434 @@ static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *__ return __pyx_r; } -/* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":245 +/* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":286 + * + * @property + * cdef inline npy_intp itemsize(self) noexcept nogil: # <<<<<<<<<<<<<< + * return PyDataType_ELSIZE(self) + * + */ + +static CYTHON_INLINE npy_intp __pyx_f_5numpy_5dtype_8itemsize_itemsize(PyArray_Descr *__pyx_v_self) { + npy_intp __pyx_r; + + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":287 + * @property + * cdef inline npy_intp itemsize(self) noexcept nogil: + * return PyDataType_ELSIZE(self) # <<<<<<<<<<<<<< + * + * @property + */ + __pyx_r = PyDataType_ELSIZE(__pyx_v_self); + goto __pyx_L0; + + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":286 + * + * @property + * cdef inline npy_intp itemsize(self) noexcept nogil: # <<<<<<<<<<<<<< + * return PyDataType_ELSIZE(self) + * + */ + + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":290 + * + * @property + * cdef inline npy_intp alignment(self) noexcept nogil: # <<<<<<<<<<<<<< + * return PyDataType_ALIGNMENT(self) + * + */ + +static CYTHON_INLINE npy_intp __pyx_f_5numpy_5dtype_9alignment_alignment(PyArray_Descr *__pyx_v_self) { + npy_intp __pyx_r; + + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":291 + * @property + * cdef inline npy_intp alignment(self) noexcept nogil: + * return PyDataType_ALIGNMENT(self) # <<<<<<<<<<<<<< + * + * # Use fields/names with care as they may be NULL. You must check + */ + __pyx_r = PyDataType_ALIGNMENT(__pyx_v_self); + goto __pyx_L0; + + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":290 + * + * @property + * cdef inline npy_intp alignment(self) noexcept nogil: # <<<<<<<<<<<<<< + * return PyDataType_ALIGNMENT(self) + * + */ + + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":296 + * # for this using PyDataType_HASFIELDS. + * @property + * cdef inline object fields(self): # <<<<<<<<<<<<<< + * return PyDataType_FIELDS(self) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_5dtype_6fields_fields(PyArray_Descr *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1; + __Pyx_RefNannySetupContext("fields", 1); + + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":297 + * @property + * cdef inline object fields(self): + * return PyDataType_FIELDS(self) # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyDataType_FIELDS(__pyx_v_self); + __Pyx_INCREF(((PyObject *)__pyx_t_1)); + __pyx_r = ((PyObject *)__pyx_t_1); + goto __pyx_L0; + + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":296 + * # for this using PyDataType_HASFIELDS. + * @property + * cdef inline object fields(self): # <<<<<<<<<<<<<< + * return PyDataType_FIELDS(self) + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":300 + * + * @property + * cdef inline tuple names(self): # <<<<<<<<<<<<<< + * return PyDataType_NAMES(self) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_5dtype_5names_names(PyArray_Descr *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1; + __Pyx_RefNannySetupContext("names", 1); + + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":301 + * @property + * cdef inline tuple names(self): + * return PyDataType_NAMES(self) # <<<<<<<<<<<<<< + * + * # Use PyDataType_HASSUBARRAY to test whether this field is + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyDataType_NAMES(__pyx_v_self); + __Pyx_INCREF(((PyObject*)__pyx_t_1)); + __pyx_r = ((PyObject*)__pyx_t_1); + goto __pyx_L0; + + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":300 + * + * @property + * cdef inline tuple names(self): # <<<<<<<<<<<<<< + * return PyDataType_NAMES(self) + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":307 + * # this field via the inline helper method PyDataType_SHAPE. + * @property + * cdef inline PyArray_ArrayDescr* subarray(self) noexcept nogil: # <<<<<<<<<<<<<< + * return PyDataType_SUBARRAY(self) + * + */ + +static CYTHON_INLINE PyArray_ArrayDescr *__pyx_f_5numpy_5dtype_8subarray_subarray(PyArray_Descr *__pyx_v_self) { + PyArray_ArrayDescr *__pyx_r; + + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":308 + * @property + * cdef inline PyArray_ArrayDescr* subarray(self) noexcept nogil: + * return PyDataType_SUBARRAY(self) # <<<<<<<<<<<<<< + * + * @property + */ + __pyx_r = PyDataType_SUBARRAY(__pyx_v_self); + goto __pyx_L0; + + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":307 + * # this field via the inline helper method PyDataType_SHAPE. + * @property + * cdef inline PyArray_ArrayDescr* subarray(self) noexcept nogil: # <<<<<<<<<<<<<< + * return PyDataType_SUBARRAY(self) + * + */ + + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":311 + * + * @property + * cdef inline npy_uint64 flags(self) noexcept nogil: # <<<<<<<<<<<<<< + * """The data types flags.""" + * return PyDataType_FLAGS(self) + */ + +static CYTHON_INLINE npy_uint64 __pyx_f_5numpy_5dtype_5flags_flags(PyArray_Descr *__pyx_v_self) { + npy_uint64 __pyx_r; + + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":313 + * cdef inline npy_uint64 flags(self) noexcept nogil: + * """The data types flags.""" + * return PyDataType_FLAGS(self) # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = PyDataType_FLAGS(__pyx_v_self); + goto __pyx_L0; + + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":311 + * + * @property + * cdef inline npy_uint64 flags(self) noexcept nogil: # <<<<<<<<<<<<<< + * """The data types flags.""" + * return PyDataType_FLAGS(self) + */ + + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":323 + * + * @property + * cdef inline int numiter(self) noexcept nogil: # <<<<<<<<<<<<<< + * """The number of arrays that need to be broadcast to the same shape.""" + * return PyArray_MultiIter_NUMITER(self) + */ + +static CYTHON_INLINE int __pyx_f_5numpy_9broadcast_7numiter_numiter(PyArrayMultiIterObject *__pyx_v_self) { + int __pyx_r; + + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":325 + * cdef inline int numiter(self) noexcept nogil: + * """The number of arrays that need to be broadcast to the same shape.""" + * return PyArray_MultiIter_NUMITER(self) # <<<<<<<<<<<<<< + * + * @property + */ + __pyx_r = PyArray_MultiIter_NUMITER(__pyx_v_self); + goto __pyx_L0; + + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":323 + * + * @property + * cdef inline int numiter(self) noexcept nogil: # <<<<<<<<<<<<<< + * """The number of arrays that need to be broadcast to the same shape.""" + * return PyArray_MultiIter_NUMITER(self) + */ + + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":328 + * + * @property + * cdef inline npy_intp size(self) noexcept nogil: # <<<<<<<<<<<<<< + * """The total broadcasted size.""" + * return PyArray_MultiIter_SIZE(self) + */ + +static CYTHON_INLINE npy_intp __pyx_f_5numpy_9broadcast_4size_size(PyArrayMultiIterObject *__pyx_v_self) { + npy_intp __pyx_r; + + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":330 + * cdef inline npy_intp size(self) noexcept nogil: + * """The total broadcasted size.""" + * return PyArray_MultiIter_SIZE(self) # <<<<<<<<<<<<<< + * + * @property + */ + __pyx_r = PyArray_MultiIter_SIZE(__pyx_v_self); + goto __pyx_L0; + + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":328 + * + * @property + * cdef inline npy_intp size(self) noexcept nogil: # <<<<<<<<<<<<<< + * """The total broadcasted size.""" + * return PyArray_MultiIter_SIZE(self) + */ + + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":333 + * + * @property + * cdef inline npy_intp index(self) noexcept nogil: # <<<<<<<<<<<<<< + * """The current (1-d) index into the broadcasted result.""" + * return PyArray_MultiIter_INDEX(self) + */ + +static CYTHON_INLINE npy_intp __pyx_f_5numpy_9broadcast_5index_index(PyArrayMultiIterObject *__pyx_v_self) { + npy_intp __pyx_r; + + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":335 + * cdef inline npy_intp index(self) noexcept nogil: + * """The current (1-d) index into the broadcasted result.""" + * return PyArray_MultiIter_INDEX(self) # <<<<<<<<<<<<<< + * + * @property + */ + __pyx_r = PyArray_MultiIter_INDEX(__pyx_v_self); + goto __pyx_L0; + + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":333 + * + * @property + * cdef inline npy_intp index(self) noexcept nogil: # <<<<<<<<<<<<<< + * """The current (1-d) index into the broadcasted result.""" + * return PyArray_MultiIter_INDEX(self) + */ + + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":338 + * + * @property + * cdef inline int nd(self) noexcept nogil: # <<<<<<<<<<<<<< + * """The number of dimensions in the broadcasted result.""" + * return PyArray_MultiIter_NDIM(self) + */ + +static CYTHON_INLINE int __pyx_f_5numpy_9broadcast_2nd_nd(PyArrayMultiIterObject *__pyx_v_self) { + int __pyx_r; + + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":340 + * cdef inline int nd(self) noexcept nogil: + * """The number of dimensions in the broadcasted result.""" + * return PyArray_MultiIter_NDIM(self) # <<<<<<<<<<<<<< + * + * @property + */ + __pyx_r = PyArray_MultiIter_NDIM(__pyx_v_self); + goto __pyx_L0; + + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":338 + * + * @property + * cdef inline int nd(self) noexcept nogil: # <<<<<<<<<<<<<< + * """The number of dimensions in the broadcasted result.""" + * return PyArray_MultiIter_NDIM(self) + */ + + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":343 + * + * @property + * cdef inline npy_intp* dimensions(self) noexcept nogil: # <<<<<<<<<<<<<< + * """The shape of the broadcasted result.""" + * return PyArray_MultiIter_DIMS(self) + */ + +static CYTHON_INLINE npy_intp *__pyx_f_5numpy_9broadcast_10dimensions_dimensions(PyArrayMultiIterObject *__pyx_v_self) { + npy_intp *__pyx_r; + + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":345 + * cdef inline npy_intp* dimensions(self) noexcept nogil: + * """The shape of the broadcasted result.""" + * return PyArray_MultiIter_DIMS(self) # <<<<<<<<<<<<<< + * + * @property + */ + __pyx_r = PyArray_MultiIter_DIMS(__pyx_v_self); + goto __pyx_L0; + + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":343 + * + * @property + * cdef inline npy_intp* dimensions(self) noexcept nogil: # <<<<<<<<<<<<<< + * """The shape of the broadcasted result.""" + * return PyArray_MultiIter_DIMS(self) + */ + + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":348 + * + * @property + * cdef inline void** iters(self) noexcept nogil: # <<<<<<<<<<<<<< + * """An array of iterator objects that holds the iterators for the arrays to be broadcast together. + * On return, the iterators are adjusted for broadcasting.""" + */ + +static CYTHON_INLINE void **__pyx_f_5numpy_9broadcast_5iters_iters(PyArrayMultiIterObject *__pyx_v_self) { + void **__pyx_r; + + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":351 + * """An array of iterator objects that holds the iterators for the arrays to be broadcast together. + * On return, the iterators are adjusted for broadcasting.""" + * return PyArray_MultiIter_ITERS(self) # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = PyArray_MultiIter_ITERS(__pyx_v_self); + goto __pyx_L0; + + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":348 + * + * @property + * cdef inline void** iters(self) noexcept nogil: # <<<<<<<<<<<<<< + * """An array of iterator objects that holds the iterators for the arrays to be broadcast together. + * On return, the iterators are adjusted for broadcasting.""" + */ + + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":366 * * @property - * cdef inline PyObject* base(self) nogil: # <<<<<<<<<<<<<< + * cdef inline PyObject* base(self) noexcept nogil: # <<<<<<<<<<<<<< * """Returns a borrowed reference to the object owning the data/memory. * """ */ @@ -18306,7 +18818,7 @@ static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *__ static CYTHON_INLINE PyObject *__pyx_f_5numpy_7ndarray_4base_base(PyArrayObject *__pyx_v_self) { PyObject *__pyx_r; - /* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":248 + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":369 * """Returns a borrowed reference to the object owning the data/memory. * """ * return PyArray_BASE(self) # <<<<<<<<<<<<<< @@ -18316,10 +18828,10 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_7ndarray_4base_base(PyArrayObject __pyx_r = PyArray_BASE(__pyx_v_self); goto __pyx_L0; - /* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":245 + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":366 * * @property - * cdef inline PyObject* base(self) nogil: # <<<<<<<<<<<<<< + * cdef inline PyObject* base(self) noexcept nogil: # <<<<<<<<<<<<<< * """Returns a borrowed reference to the object owning the data/memory. * """ */ @@ -18329,7 +18841,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_7ndarray_4base_base(PyArrayObject return __pyx_r; } -/* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":251 +/* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":372 * * @property * cdef inline dtype descr(self): # <<<<<<<<<<<<<< @@ -18343,7 +18855,7 @@ static CYTHON_INLINE PyArray_Descr *__pyx_f_5numpy_7ndarray_5descr_descr(PyArray PyArray_Descr *__pyx_t_1; __Pyx_RefNannySetupContext("descr", 1); - /* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":254 + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":375 * """Returns an owned reference to the dtype of the array. * """ * return PyArray_DESCR(self) # <<<<<<<<<<<<<< @@ -18356,7 +18868,7 @@ static CYTHON_INLINE PyArray_Descr *__pyx_f_5numpy_7ndarray_5descr_descr(PyArray __pyx_r = ((PyArray_Descr *)__pyx_t_1); goto __pyx_L0; - /* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":251 + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":372 * * @property * cdef inline dtype descr(self): # <<<<<<<<<<<<<< @@ -18371,10 +18883,10 @@ static CYTHON_INLINE PyArray_Descr *__pyx_f_5numpy_7ndarray_5descr_descr(PyArray return __pyx_r; } -/* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":257 +/* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":378 * * @property - * cdef inline int ndim(self) nogil: # <<<<<<<<<<<<<< + * cdef inline int ndim(self) noexcept nogil: # <<<<<<<<<<<<<< * """Returns the number of dimensions in the array. * """ */ @@ -18382,7 +18894,7 @@ static CYTHON_INLINE PyArray_Descr *__pyx_f_5numpy_7ndarray_5descr_descr(PyArray static CYTHON_INLINE int __pyx_f_5numpy_7ndarray_4ndim_ndim(PyArrayObject *__pyx_v_self) { int __pyx_r; - /* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":260 + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":381 * """Returns the number of dimensions in the array. * """ * return PyArray_NDIM(self) # <<<<<<<<<<<<<< @@ -18392,10 +18904,10 @@ static CYTHON_INLINE int __pyx_f_5numpy_7ndarray_4ndim_ndim(PyArrayObject *__pyx __pyx_r = PyArray_NDIM(__pyx_v_self); goto __pyx_L0; - /* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":257 + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":378 * * @property - * cdef inline int ndim(self) nogil: # <<<<<<<<<<<<<< + * cdef inline int ndim(self) noexcept nogil: # <<<<<<<<<<<<<< * """Returns the number of dimensions in the array. * """ */ @@ -18405,10 +18917,10 @@ static CYTHON_INLINE int __pyx_f_5numpy_7ndarray_4ndim_ndim(PyArrayObject *__pyx return __pyx_r; } -/* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":263 +/* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":384 * * @property - * cdef inline npy_intp *shape(self) nogil: # <<<<<<<<<<<<<< + * cdef inline npy_intp *shape(self) noexcept nogil: # <<<<<<<<<<<<<< * """Returns a pointer to the dimensions/shape of the array. * The number of elements matches the number of dimensions of the array (ndim). */ @@ -18416,7 +18928,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_7ndarray_4ndim_ndim(PyArrayObject *__pyx static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_5shape_shape(PyArrayObject *__pyx_v_self) { npy_intp *__pyx_r; - /* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":268 + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":389 * Can return NULL for 0-dimensional arrays. * """ * return PyArray_DIMS(self) # <<<<<<<<<<<<<< @@ -18426,10 +18938,10 @@ static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_5shape_shape(PyArrayObjec __pyx_r = PyArray_DIMS(__pyx_v_self); goto __pyx_L0; - /* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":263 + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":384 * * @property - * cdef inline npy_intp *shape(self) nogil: # <<<<<<<<<<<<<< + * cdef inline npy_intp *shape(self) noexcept nogil: # <<<<<<<<<<<<<< * """Returns a pointer to the dimensions/shape of the array. * The number of elements matches the number of dimensions of the array (ndim). */ @@ -18439,10 +18951,10 @@ static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_5shape_shape(PyArrayObjec return __pyx_r; } -/* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":271 +/* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":392 * * @property - * cdef inline npy_intp *strides(self) nogil: # <<<<<<<<<<<<<< + * cdef inline npy_intp *strides(self) noexcept nogil: # <<<<<<<<<<<<<< * """Returns a pointer to the strides of the array. * The number of elements matches the number of dimensions of the array (ndim). */ @@ -18450,7 +18962,7 @@ static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_5shape_shape(PyArrayObjec static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_7strides_strides(PyArrayObject *__pyx_v_self) { npy_intp *__pyx_r; - /* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":275 + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":396 * The number of elements matches the number of dimensions of the array (ndim). * """ * return PyArray_STRIDES(self) # <<<<<<<<<<<<<< @@ -18460,10 +18972,10 @@ static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_7strides_strides(PyArrayO __pyx_r = PyArray_STRIDES(__pyx_v_self); goto __pyx_L0; - /* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":271 + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":392 * * @property - * cdef inline npy_intp *strides(self) nogil: # <<<<<<<<<<<<<< + * cdef inline npy_intp *strides(self) noexcept nogil: # <<<<<<<<<<<<<< * """Returns a pointer to the strides of the array. * The number of elements matches the number of dimensions of the array (ndim). */ @@ -18473,10 +18985,10 @@ static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_7strides_strides(PyArrayO return __pyx_r; } -/* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":278 +/* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":399 * * @property - * cdef inline npy_intp size(self) nogil: # <<<<<<<<<<<<<< + * cdef inline npy_intp size(self) noexcept nogil: # <<<<<<<<<<<<<< * """Returns the total size (in number of elements) of the array. * """ */ @@ -18484,7 +18996,7 @@ static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_7strides_strides(PyArrayO static CYTHON_INLINE npy_intp __pyx_f_5numpy_7ndarray_4size_size(PyArrayObject *__pyx_v_self) { npy_intp __pyx_r; - /* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":281 + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":402 * """Returns the total size (in number of elements) of the array. * """ * return PyArray_SIZE(self) # <<<<<<<<<<<<<< @@ -18494,10 +19006,10 @@ static CYTHON_INLINE npy_intp __pyx_f_5numpy_7ndarray_4size_size(PyArrayObject * __pyx_r = PyArray_SIZE(__pyx_v_self); goto __pyx_L0; - /* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":278 + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":399 * * @property - * cdef inline npy_intp size(self) nogil: # <<<<<<<<<<<<<< + * cdef inline npy_intp size(self) noexcept nogil: # <<<<<<<<<<<<<< * """Returns the total size (in number of elements) of the array. * """ */ @@ -18507,10 +19019,10 @@ static CYTHON_INLINE npy_intp __pyx_f_5numpy_7ndarray_4size_size(PyArrayObject * return __pyx_r; } -/* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":284 +/* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":405 * * @property - * cdef inline char* data(self) nogil: # <<<<<<<<<<<<<< + * cdef inline char* data(self) noexcept nogil: # <<<<<<<<<<<<<< * """The pointer to the data buffer as a char*. * This is provided for legacy reasons to avoid direct struct field access. */ @@ -18518,20 +19030,20 @@ static CYTHON_INLINE npy_intp __pyx_f_5numpy_7ndarray_4size_size(PyArrayObject * static CYTHON_INLINE char *__pyx_f_5numpy_7ndarray_4data_data(PyArrayObject *__pyx_v_self) { char *__pyx_r; - /* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":290 + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":411 * of `PyArray_DATA()` instead, which returns a 'void*'. * """ * return PyArray_BYTES(self) # <<<<<<<<<<<<<< * - * ctypedef unsigned char npy_bool + * */ __pyx_r = PyArray_BYTES(__pyx_v_self); goto __pyx_L0; - /* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":284 + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":405 * * @property - * cdef inline char* data(self) nogil: # <<<<<<<<<<<<<< + * cdef inline char* data(self) noexcept nogil: # <<<<<<<<<<<<<< * """The pointer to the data buffer as a char*. * This is provided for legacy reasons to avoid direct struct field access. */ @@ -18541,8 +19053,8 @@ static CYTHON_INLINE char *__pyx_f_5numpy_7ndarray_4data_data(PyArrayObject *__p return __pyx_r; } -/* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":773 - * ctypedef npy_cdouble complex_t +/* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":806 + * ctypedef long double complex clongdouble_t * * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< * return PyArray_MultiIterNew(1, a) @@ -18558,7 +19070,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 1); - /* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":774 + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":807 * * cdef inline object PyArray_MultiIterNew1(a): * return PyArray_MultiIterNew(1, a) # <<<<<<<<<<<<<< @@ -18566,14 +19078,14 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ * cdef inline object PyArray_MultiIterNew2(a, b): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 774, __pyx_L1_error) + __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 807, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":773 - * ctypedef npy_cdouble complex_t + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":806 + * ctypedef long double complex clongdouble_t * * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< * return PyArray_MultiIterNew(1, a) @@ -18591,7 +19103,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ return __pyx_r; } -/* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":776 +/* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":809 * return PyArray_MultiIterNew(1, a) * * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< @@ -18608,7 +19120,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 1); - /* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":777 + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":810 * * cdef inline object PyArray_MultiIterNew2(a, b): * return PyArray_MultiIterNew(2, a, b) # <<<<<<<<<<<<<< @@ -18616,13 +19128,13 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ * cdef inline object PyArray_MultiIterNew3(a, b, c): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 777, __pyx_L1_error) + __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 810, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":776 + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":809 * return PyArray_MultiIterNew(1, a) * * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< @@ -18641,7 +19153,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ return __pyx_r; } -/* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":779 +/* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":812 * return PyArray_MultiIterNew(2, a, b) * * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< @@ -18658,7 +19170,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 1); - /* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":780 + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":813 * * cdef inline object PyArray_MultiIterNew3(a, b, c): * return PyArray_MultiIterNew(3, a, b, c) # <<<<<<<<<<<<<< @@ -18666,13 +19178,13 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ * cdef inline object PyArray_MultiIterNew4(a, b, c, d): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 780, __pyx_L1_error) + __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 813, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":779 + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":812 * return PyArray_MultiIterNew(2, a, b) * * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< @@ -18691,7 +19203,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ return __pyx_r; } -/* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":782 +/* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":815 * return PyArray_MultiIterNew(3, a, b, c) * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< @@ -18708,7 +19220,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 1); - /* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":783 + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":816 * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): * return PyArray_MultiIterNew(4, a, b, c, d) # <<<<<<<<<<<<<< @@ -18716,13 +19228,13 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 783, __pyx_L1_error) + __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 816, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":782 + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":815 * return PyArray_MultiIterNew(3, a, b, c) * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< @@ -18741,7 +19253,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ return __pyx_r; } -/* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":785 +/* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":818 * return PyArray_MultiIterNew(4, a, b, c, d) * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< @@ -18758,7 +19270,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 1); - /* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":786 + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":819 * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): * return PyArray_MultiIterNew(5, a, b, c, d, e) # <<<<<<<<<<<<<< @@ -18766,13 +19278,13 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ * cdef inline tuple PyDataType_SHAPE(dtype d): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 786, __pyx_L1_error) + __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 819, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":785 + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":818 * return PyArray_MultiIterNew(4, a, b, c, d) * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< @@ -18791,7 +19303,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ return __pyx_r; } -/* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":788 +/* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":821 * return PyArray_MultiIterNew(5, a, b, c, d, e) * * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<< @@ -18803,9 +19315,10 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; + PyObject *__pyx_t_2; __Pyx_RefNannySetupContext("PyDataType_SHAPE", 1); - /* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":789 + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":822 * * cdef inline tuple PyDataType_SHAPE(dtype d): * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<< @@ -18815,7 +19328,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ __pyx_t_1 = PyDataType_HASSUBARRAY(__pyx_v_d); if (__pyx_t_1) { - /* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":790 + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":823 * cdef inline tuple PyDataType_SHAPE(dtype d): * if PyDataType_HASSUBARRAY(d): * return d.subarray.shape # <<<<<<<<<<<<<< @@ -18823,11 +19336,12 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ * return () */ __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject*)__pyx_v_d->subarray->shape)); - __pyx_r = ((PyObject*)__pyx_v_d->subarray->shape); + __pyx_t_2 = __pyx_f_5numpy_5dtype_8subarray_subarray(__pyx_v_d)->shape; + __Pyx_INCREF(((PyObject*)__pyx_t_2)); + __pyx_r = ((PyObject*)__pyx_t_2); goto __pyx_L0; - /* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":789 + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":822 * * cdef inline tuple PyDataType_SHAPE(dtype d): * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<< @@ -18836,7 +19350,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ */ } - /* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":792 + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":825 * return d.subarray.shape * else: * return () # <<<<<<<<<<<<<< @@ -18850,7 +19364,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ goto __pyx_L0; } - /* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":788 + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":821 * return PyArray_MultiIterNew(5, a, b, c, d, e) * * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<< @@ -18865,10 +19379,10 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ return __pyx_r; } -/* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":967 +/* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1009 * int _import_umath() except -1 * - * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< + * cdef inline void set_array_base(ndarray arr, object base) except *: # <<<<<<<<<<<<<< * Py_INCREF(base) # important to do this before stealing the reference below! * PyArray_SetBaseObject(arr, base) */ @@ -18879,28 +19393,28 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a const char *__pyx_filename = NULL; int __pyx_clineno = 0; - /* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":968 + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1010 * - * cdef inline void set_array_base(ndarray arr, object base): + * cdef inline void set_array_base(ndarray arr, object base) except *: * Py_INCREF(base) # important to do this before stealing the reference below! # <<<<<<<<<<<<<< * PyArray_SetBaseObject(arr, base) * */ Py_INCREF(__pyx_v_base); - /* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":969 - * cdef inline void set_array_base(ndarray arr, object base): + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1011 + * cdef inline void set_array_base(ndarray arr, object base) except *: * Py_INCREF(base) # important to do this before stealing the reference below! * PyArray_SetBaseObject(arr, base) # <<<<<<<<<<<<<< * * cdef inline object get_array_base(ndarray arr): */ - __pyx_t_1 = PyArray_SetBaseObject(__pyx_v_arr, __pyx_v_base); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(2, 969, __pyx_L1_error) + __pyx_t_1 = PyArray_SetBaseObject(__pyx_v_arr, __pyx_v_base); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(2, 1011, __pyx_L1_error) - /* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":967 + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1009 * int _import_umath() except -1 * - * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< + * cdef inline void set_array_base(ndarray arr, object base) except *: # <<<<<<<<<<<<<< * Py_INCREF(base) # important to do this before stealing the reference below! * PyArray_SetBaseObject(arr, base) */ @@ -18912,7 +19426,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a __pyx_L0:; } -/* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":971 +/* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1013 * PyArray_SetBaseObject(arr, base) * * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< @@ -18927,7 +19441,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py int __pyx_t_1; __Pyx_RefNannySetupContext("get_array_base", 1); - /* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":972 + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1014 * * cdef inline object get_array_base(ndarray arr): * base = PyArray_BASE(arr) # <<<<<<<<<<<<<< @@ -18936,7 +19450,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py */ __pyx_v_base = PyArray_BASE(__pyx_v_arr); - /* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":973 + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1015 * cdef inline object get_array_base(ndarray arr): * base = PyArray_BASE(arr) * if base is NULL: # <<<<<<<<<<<<<< @@ -18946,7 +19460,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py __pyx_t_1 = (__pyx_v_base == NULL); if (__pyx_t_1) { - /* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":974 + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1016 * base = PyArray_BASE(arr) * if base is NULL: * return None # <<<<<<<<<<<<<< @@ -18957,7 +19471,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - /* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":973 + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1015 * cdef inline object get_array_base(ndarray arr): * base = PyArray_BASE(arr) * if base is NULL: # <<<<<<<<<<<<<< @@ -18966,7 +19480,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py */ } - /* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":975 + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1017 * if base is NULL: * return None * return base # <<<<<<<<<<<<<< @@ -18978,7 +19492,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py __pyx_r = ((PyObject *)__pyx_v_base); goto __pyx_L0; - /* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":971 + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1013 * PyArray_SetBaseObject(arr, base) * * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< @@ -18993,7 +19507,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py return __pyx_r; } -/* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":979 +/* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1021 * # Versions of the import_* functions which are more suitable for * # Cython code. * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< @@ -19017,7 +19531,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { int __pyx_clineno = 0; __Pyx_RefNannySetupContext("import_array", 1); - /* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":980 + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1022 * # Cython code. * cdef inline int import_array() except -1: * try: # <<<<<<<<<<<<<< @@ -19033,16 +19547,16 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { - /* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":981 + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1023 * cdef inline int import_array() except -1: * try: * __pyx_import_array() # <<<<<<<<<<<<<< * except Exception: - * raise ImportError("numpy.core.multiarray failed to import") + * raise ImportError("numpy._core.multiarray failed to import") */ - __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 981, __pyx_L3_error) + __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 1023, __pyx_L3_error) - /* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":980 + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1022 * # Cython code. * cdef inline int import_array() except -1: * try: # <<<<<<<<<<<<<< @@ -19056,37 +19570,37 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { goto __pyx_L8_try_end; __pyx_L3_error:; - /* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":982 + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1024 * try: * __pyx_import_array() * except Exception: # <<<<<<<<<<<<<< - * raise ImportError("numpy.core.multiarray failed to import") + * raise ImportError("numpy._core.multiarray failed to import") * */ __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); if (__pyx_t_4) { __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 982, __pyx_L5_except_error) + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 1024, __pyx_L5_except_error) __Pyx_XGOTREF(__pyx_t_5); __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_7); - /* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":983 + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1025 * __pyx_import_array() * except Exception: - * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<< + * raise ImportError("numpy._core.multiarray failed to import") # <<<<<<<<<<<<<< * * cdef inline int import_umath() except -1: */ - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 983, __pyx_L5_except_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1025, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_Raise(__pyx_t_8, 0, 0, 0); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __PYX_ERR(2, 983, __pyx_L5_except_error) + __PYX_ERR(2, 1025, __pyx_L5_except_error) } goto __pyx_L5_except_error; - /* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":980 + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1022 * # Cython code. * cdef inline int import_array() except -1: * try: # <<<<<<<<<<<<<< @@ -19102,7 +19616,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { __pyx_L8_try_end:; } - /* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":979 + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1021 * # Versions of the import_* functions which are more suitable for * # Cython code. * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< @@ -19125,8 +19639,8 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { return __pyx_r; } -/* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":985 - * raise ImportError("numpy.core.multiarray failed to import") +/* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1027 + * raise ImportError("numpy._core.multiarray failed to import") * * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< * try: @@ -19149,7 +19663,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { int __pyx_clineno = 0; __Pyx_RefNannySetupContext("import_umath", 1); - /* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":986 + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1028 * * cdef inline int import_umath() except -1: * try: # <<<<<<<<<<<<<< @@ -19165,16 +19679,16 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { - /* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":987 + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1029 * cdef inline int import_umath() except -1: * try: * _import_umath() # <<<<<<<<<<<<<< * except Exception: - * raise ImportError("numpy.core.umath failed to import") + * raise ImportError("numpy._core.umath failed to import") */ - __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 987, __pyx_L3_error) + __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 1029, __pyx_L3_error) - /* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":986 + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1028 * * cdef inline int import_umath() except -1: * try: # <<<<<<<<<<<<<< @@ -19188,37 +19702,37 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { goto __pyx_L8_try_end; __pyx_L3_error:; - /* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":988 + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1030 * try: * _import_umath() * except Exception: # <<<<<<<<<<<<<< - * raise ImportError("numpy.core.umath failed to import") + * raise ImportError("numpy._core.umath failed to import") * */ __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); if (__pyx_t_4) { __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 988, __pyx_L5_except_error) + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 1030, __pyx_L5_except_error) __Pyx_XGOTREF(__pyx_t_5); __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_7); - /* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":989 + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1031 * _import_umath() * except Exception: - * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< + * raise ImportError("numpy._core.umath failed to import") # <<<<<<<<<<<<<< * * cdef inline int import_ufunc() except -1: */ - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 989, __pyx_L5_except_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1031, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_Raise(__pyx_t_8, 0, 0, 0); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __PYX_ERR(2, 989, __pyx_L5_except_error) + __PYX_ERR(2, 1031, __pyx_L5_except_error) } goto __pyx_L5_except_error; - /* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":986 + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1028 * * cdef inline int import_umath() except -1: * try: # <<<<<<<<<<<<<< @@ -19234,8 +19748,8 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { __pyx_L8_try_end:; } - /* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":985 - * raise ImportError("numpy.core.multiarray failed to import") + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1027 + * raise ImportError("numpy._core.multiarray failed to import") * * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< * try: @@ -19257,8 +19771,8 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { return __pyx_r; } -/* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":991 - * raise ImportError("numpy.core.umath failed to import") +/* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1033 + * raise ImportError("numpy._core.umath failed to import") * * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< * try: @@ -19281,7 +19795,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { int __pyx_clineno = 0; __Pyx_RefNannySetupContext("import_ufunc", 1); - /* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":992 + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1034 * * cdef inline int import_ufunc() except -1: * try: # <<<<<<<<<<<<<< @@ -19297,16 +19811,16 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { - /* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":993 + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1035 * cdef inline int import_ufunc() except -1: * try: * _import_umath() # <<<<<<<<<<<<<< * except Exception: - * raise ImportError("numpy.core.umath failed to import") + * raise ImportError("numpy._core.umath failed to import") */ - __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 993, __pyx_L3_error) + __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 1035, __pyx_L3_error) - /* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":992 + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1034 * * cdef inline int import_ufunc() except -1: * try: # <<<<<<<<<<<<<< @@ -19320,37 +19834,37 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { goto __pyx_L8_try_end; __pyx_L3_error:; - /* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":994 + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1036 * try: * _import_umath() * except Exception: # <<<<<<<<<<<<<< - * raise ImportError("numpy.core.umath failed to import") + * raise ImportError("numpy._core.umath failed to import") * */ __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); if (__pyx_t_4) { __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 994, __pyx_L5_except_error) + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 1036, __pyx_L5_except_error) __Pyx_XGOTREF(__pyx_t_5); __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_7); - /* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":995 + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1037 * _import_umath() * except Exception: - * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< + * raise ImportError("numpy._core.umath failed to import") # <<<<<<<<<<<<<< * * */ - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 995, __pyx_L5_except_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1037, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_Raise(__pyx_t_8, 0, 0, 0); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __PYX_ERR(2, 995, __pyx_L5_except_error) + __PYX_ERR(2, 1037, __pyx_L5_except_error) } goto __pyx_L5_except_error; - /* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":992 + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1034 * * cdef inline int import_ufunc() except -1: * try: # <<<<<<<<<<<<<< @@ -19366,8 +19880,8 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { __pyx_L8_try_end:; } - /* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":991 - * raise ImportError("numpy.core.umath failed to import") + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1033 + * raise ImportError("numpy._core.umath failed to import") * * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< * try: @@ -19389,10 +19903,10 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { return __pyx_r; } -/* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":998 +/* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1040 * * - * cdef inline bint is_timedelta64_object(object obj): # <<<<<<<<<<<<<< + * cdef inline bint is_timedelta64_object(object obj) noexcept: # <<<<<<<<<<<<<< * """ * Cython equivalent of `isinstance(obj, np.timedelta64)` */ @@ -19400,7 +19914,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { static CYTHON_INLINE int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_obj) { int __pyx_r; - /* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1010 + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1052 * bool * """ * return PyObject_TypeCheck(obj, &PyTimedeltaArrType_Type) # <<<<<<<<<<<<<< @@ -19410,10 +19924,10 @@ static CYTHON_INLINE int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_ __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyTimedeltaArrType_Type)); goto __pyx_L0; - /* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":998 + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1040 * * - * cdef inline bint is_timedelta64_object(object obj): # <<<<<<<<<<<<<< + * cdef inline bint is_timedelta64_object(object obj) noexcept: # <<<<<<<<<<<<<< * """ * Cython equivalent of `isinstance(obj, np.timedelta64)` */ @@ -19423,10 +19937,10 @@ static CYTHON_INLINE int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_ return __pyx_r; } -/* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1013 +/* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1055 * * - * cdef inline bint is_datetime64_object(object obj): # <<<<<<<<<<<<<< + * cdef inline bint is_datetime64_object(object obj) noexcept: # <<<<<<<<<<<<<< * """ * Cython equivalent of `isinstance(obj, np.datetime64)` */ @@ -19434,7 +19948,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_ static CYTHON_INLINE int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_obj) { int __pyx_r; - /* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1025 + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1067 * bool * """ * return PyObject_TypeCheck(obj, &PyDatetimeArrType_Type) # <<<<<<<<<<<<<< @@ -19444,10 +19958,10 @@ static CYTHON_INLINE int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_o __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyDatetimeArrType_Type)); goto __pyx_L0; - /* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1013 + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1055 * * - * cdef inline bint is_datetime64_object(object obj): # <<<<<<<<<<<<<< + * cdef inline bint is_datetime64_object(object obj) noexcept: # <<<<<<<<<<<<<< * """ * Cython equivalent of `isinstance(obj, np.datetime64)` */ @@ -19457,10 +19971,10 @@ static CYTHON_INLINE int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_o return __pyx_r; } -/* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1028 +/* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1070 * * - * cdef inline npy_datetime get_datetime64_value(object obj) nogil: # <<<<<<<<<<<<<< + * cdef inline npy_datetime get_datetime64_value(object obj) noexcept nogil: # <<<<<<<<<<<<<< * """ * returns the int64 value underlying scalar numpy datetime64 object */ @@ -19468,7 +19982,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_o static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject *__pyx_v_obj) { npy_datetime __pyx_r; - /* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1035 + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1077 * also needed. That can be found using `get_datetime64_unit`. * """ * return (obj).obval # <<<<<<<<<<<<<< @@ -19478,10 +19992,10 @@ static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject * __pyx_r = ((PyDatetimeScalarObject *)__pyx_v_obj)->obval; goto __pyx_L0; - /* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1028 + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1070 * * - * cdef inline npy_datetime get_datetime64_value(object obj) nogil: # <<<<<<<<<<<<<< + * cdef inline npy_datetime get_datetime64_value(object obj) noexcept nogil: # <<<<<<<<<<<<<< * """ * returns the int64 value underlying scalar numpy datetime64 object */ @@ -19491,10 +20005,10 @@ static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject * return __pyx_r; } -/* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1038 +/* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1080 * * - * cdef inline npy_timedelta get_timedelta64_value(object obj) nogil: # <<<<<<<<<<<<<< + * cdef inline npy_timedelta get_timedelta64_value(object obj) noexcept nogil: # <<<<<<<<<<<<<< * """ * returns the int64 value underlying scalar numpy timedelta64 object */ @@ -19502,7 +20016,7 @@ static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject * static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject *__pyx_v_obj) { npy_timedelta __pyx_r; - /* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1042 + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1084 * returns the int64 value underlying scalar numpy timedelta64 object * """ * return (obj).obval # <<<<<<<<<<<<<< @@ -19512,10 +20026,10 @@ static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject __pyx_r = ((PyTimedeltaScalarObject *)__pyx_v_obj)->obval; goto __pyx_L0; - /* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1038 + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1080 * * - * cdef inline npy_timedelta get_timedelta64_value(object obj) nogil: # <<<<<<<<<<<<<< + * cdef inline npy_timedelta get_timedelta64_value(object obj) noexcept nogil: # <<<<<<<<<<<<<< * """ * returns the int64 value underlying scalar numpy timedelta64 object */ @@ -19525,10 +20039,10 @@ static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject return __pyx_r; } -/* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1045 +/* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1087 * * - * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) nogil: # <<<<<<<<<<<<<< + * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) noexcept nogil: # <<<<<<<<<<<<<< * """ * returns the unit part of the dtype for a numpy datetime64 object. */ @@ -19536,18 +20050,20 @@ static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject static CYTHON_INLINE NPY_DATETIMEUNIT __pyx_f_5numpy_get_datetime64_unit(PyObject *__pyx_v_obj) { NPY_DATETIMEUNIT __pyx_r; - /* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1049 + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1091 * returns the unit part of the dtype for a numpy datetime64 object. * """ * return (obj).obmeta.base # <<<<<<<<<<<<<< + * + * */ __pyx_r = ((NPY_DATETIMEUNIT)((PyDatetimeScalarObject *)__pyx_v_obj)->obmeta.base); goto __pyx_L0; - /* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1045 + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1087 * * - * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) nogil: # <<<<<<<<<<<<<< + * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) noexcept nogil: # <<<<<<<<<<<<<< * """ * returns the unit part of the dtype for a numpy datetime64 object. */ @@ -19652,7 +20168,7 @@ static PyArrayObject *__pyx_f_7fastkde_5nufft_nuifft(__Pyx_memviewslice __pyx_v_ int __pyx_v_t; int __pyx_v_iNotMissing; __Pyx_memviewslice __pyx_v_frequencySizes = { 0, 0, { 0 }, { 0 }, { 0 } }; - __pyx_t_5numpy_int_t __pyx_v_freqSpaceSize; + __pyx_t_5numpy_int64_t __pyx_v_freqSpaceSize; __Pyx_memviewslice __pyx_v_abscissaGrids = { 0, 0, { 0 }, { 0 }, { 0 } }; PyObject *__pyx_v_xdum = NULL; __pyx_t_5numpy_float_t __pyx_v_tau; @@ -19684,39 +20200,41 @@ static PyArrayObject *__pyx_f_7fastkde_5nufft_nuifft(__Pyx_memviewslice __pyx_v_ PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; - int __pyx_t_5; + unsigned int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; int __pyx_t_9; - PyObject *__pyx_t_10 = NULL; - __Pyx_memviewslice __pyx_t_11 = { 0, 0, { 0 }, { 0 }, { 0 } }; - int __pyx_t_12; + int __pyx_t_10; + PyObject *__pyx_t_11 = NULL; + __Pyx_memviewslice __pyx_t_12 = { 0, 0, { 0 }, { 0 }, { 0 } }; int __pyx_t_13; int __pyx_t_14; int __pyx_t_15; int __pyx_t_16; - Py_ssize_t __pyx_t_17; + int __pyx_t_17; Py_ssize_t __pyx_t_18; - __pyx_t_5numpy_int_t __pyx_t_19; - PyObject *__pyx_t_20 = NULL; - __Pyx_memviewslice __pyx_t_21 = { 0, 0, { 0 }, { 0 }, { 0 } }; + Py_ssize_t __pyx_t_19; + __pyx_t_5numpy_int64_t __pyx_t_20; + PyObject *__pyx_t_21 = NULL; __Pyx_memviewslice __pyx_t_22 = { 0, 0, { 0 }, { 0 }, { 0 } }; - __pyx_t_5numpy_int_t __pyx_t_23; - __pyx_t_5numpy_float_t __pyx_t_24; - Py_ssize_t __pyx_t_25; + __Pyx_memviewslice __pyx_t_23 = { 0, 0, { 0 }, { 0 }, { 0 } }; + __pyx_t_5numpy_int64_t __pyx_t_24; + __pyx_t_5numpy_float_t __pyx_t_25; Py_ssize_t __pyx_t_26; - __Pyx_memviewslice __pyx_t_27 = { 0, 0, { 0 }, { 0 }, { 0 } }; - __pyx_t_5numpy_float_t __pyx_t_28; - long __pyx_t_29; + Py_ssize_t __pyx_t_27; + __Pyx_memviewslice __pyx_t_28 = { 0, 0, { 0 }, { 0 }, { 0 } }; + __pyx_t_5numpy_float_t __pyx_t_29; long __pyx_t_30; - int __pyx_t_31; + long __pyx_t_31; int __pyx_t_32; - PyObject *__pyx_t_33 = NULL; + int __pyx_t_33; PyObject *__pyx_t_34 = NULL; PyObject *__pyx_t_35 = NULL; PyObject *__pyx_t_36 = NULL; PyObject *__pyx_t_37 = NULL; + PyObject *__pyx_t_38 = NULL; + __pyx_t_5numpy_int64_t __pyx_t_39; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; @@ -19825,9 +20343,9 @@ static PyArrayObject *__pyx_f_7fastkde_5nufft_nuifft(__Pyx_memviewslice __pyx_v_ __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 87, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 87, __pyx_L3_error) + __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 87, __pyx_L3_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_v_numDimensions = __pyx_t_5; + __pyx_v_numDimensions = __pyx_t_9; /* "fastkde/nufft.pyx":88 * try: @@ -19869,9 +20387,9 @@ static PyArrayObject *__pyx_f_7fastkde_5nufft_nuifft(__Pyx_memviewslice __pyx_v_ __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_3, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 88, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 88, __pyx_L3_error) + __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 88, __pyx_L3_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_v_numDataPoints = __pyx_t_5; + __pyx_v_numDataPoints = __pyx_t_9; /* "fastkde/nufft.pyx":86 * vprint("Checking dimensionalities and arguments",be_verbose) @@ -20067,9 +20585,9 @@ static PyArrayObject *__pyx_f_7fastkde_5nufft_nuifft(__Pyx_memviewslice __pyx_v_ __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = PyObject_RichCompare(__pyx_v_ordShape, __pyx_t_3, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 98, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 98, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 98, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(__pyx_t_9)) { + if (unlikely(__pyx_t_10)) { /* "fastkde/nufft.pyx":99 * @@ -20225,9 +20743,9 @@ static PyArrayObject *__pyx_f_7fastkde_5nufft_nuifft(__Pyx_memviewslice __pyx_v_ __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 107, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 107, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 107, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(__pyx_t_9)) { + if (unlikely(__pyx_t_10)) { /* "fastkde/nufft.pyx":108 * @@ -20260,16 +20778,16 @@ static PyArrayObject *__pyx_f_7fastkde_5nufft_nuifft(__Pyx_memviewslice __pyx_v_ */ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_freqShape, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 111, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 111, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 111, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_v_ntMax = __pyx_t_5; + __pyx_v_ntMax = __pyx_t_9; /* "fastkde/nufft.pyx":117 * # Calculate the size of the frequency spaces * #******************************************** * vprint("Getting the size of the frequency spaces",be_verbose) # <<<<<<<<<<<<<< * cdef int n,t,iNotMissing - * cdef np.int_t [:] frequencySizes = np.zeros([numDimensions],dtype=np.int_) + * cdef np.int64_t [:] frequencySizes = np.zeros([numDimensions],dtype=np.int_) */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_vprint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 117, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); @@ -20303,7 +20821,7 @@ static PyArrayObject *__pyx_f_7fastkde_5nufft_nuifft(__Pyx_memviewslice __pyx_v_ /* "fastkde/nufft.pyx":119 * vprint("Getting the size of the frequency spaces",be_verbose) * cdef int n,t,iNotMissing - * cdef np.int_t [:] frequencySizes = np.zeros([numDimensions],dtype=np.int_) # <<<<<<<<<<<<<< + * cdef np.int64_t [:] frequencySizes = np.zeros([numDimensions],dtype=np.int_) # <<<<<<<<<<<<<< * * for n in range(numDimensions): */ @@ -20328,33 +20846,33 @@ static PyArrayObject *__pyx_f_7fastkde_5nufft_nuifft(__Pyx_memviewslice __pyx_v_ __Pyx_GOTREF(__pyx_t_3); __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 119, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_int); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 119, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_int); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 119, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_10) < 0) __PYX_ERR(0, 119, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 119, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_11) < 0) __PYX_ERR(0, 119, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 119, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int_t(__pyx_t_10, PyBUF_WRITABLE); if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 119, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_v_frequencySizes = __pyx_t_11; - __pyx_t_11.memview = NULL; - __pyx_t_11.data = NULL; + __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(__pyx_t_11, PyBUF_WRITABLE); if (unlikely(!__pyx_t_12.memview)) __PYX_ERR(0, 119, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_v_frequencySizes = __pyx_t_12; + __pyx_t_12.memview = NULL; + __pyx_t_12.data = NULL; /* "fastkde/nufft.pyx":121 - * cdef np.int_t [:] frequencySizes = np.zeros([numDimensions],dtype=np.int_) + * cdef np.int64_t [:] frequencySizes = np.zeros([numDimensions],dtype=np.int_) * * for n in range(numDimensions): # <<<<<<<<<<<<<< * iNotMissing = 0 * for t in range(ntMax): */ - __pyx_t_5 = __pyx_v_numDimensions; - __pyx_t_12 = __pyx_t_5; - for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) { - __pyx_v_n = __pyx_t_13; + __pyx_t_9 = __pyx_v_numDimensions; + __pyx_t_13 = __pyx_t_9; + for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) { + __pyx_v_n = __pyx_t_14; /* "fastkde/nufft.pyx":122 * @@ -20372,10 +20890,10 @@ static PyArrayObject *__pyx_f_7fastkde_5nufft_nuifft(__Pyx_memviewslice __pyx_v_ * if frequency_grids[n,t] != missing_freq_val: * iNotMissing += 1 */ - __pyx_t_14 = __pyx_v_ntMax; - __pyx_t_15 = __pyx_t_14; - for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) { - __pyx_v_t = __pyx_t_16; + __pyx_t_15 = __pyx_v_ntMax; + __pyx_t_16 = __pyx_t_15; + for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) { + __pyx_v_t = __pyx_t_17; /* "fastkde/nufft.pyx":124 * iNotMissing = 0 @@ -20384,19 +20902,19 @@ static PyArrayObject *__pyx_f_7fastkde_5nufft_nuifft(__Pyx_memviewslice __pyx_v_ * iNotMissing += 1 * if iNotMissing != 0: */ - __pyx_t_17 = __pyx_v_n; - __pyx_t_18 = __pyx_v_t; - if (__pyx_t_17 < 0) __pyx_t_17 += __pyx_v_frequency_grids.shape[0]; - if (__pyx_t_18 < 0) __pyx_t_18 += __pyx_v_frequency_grids.shape[1]; - __pyx_t_9 = ((*((__pyx_t_5numpy_float_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_frequency_grids.data + __pyx_t_17 * __pyx_v_frequency_grids.strides[0]) ) + __pyx_t_18 * __pyx_v_frequency_grids.strides[1]) ))) != __pyx_v_missing_freq_val); - if (__pyx_t_9) { + __pyx_t_18 = __pyx_v_n; + __pyx_t_19 = __pyx_v_t; + if (__pyx_t_18 < 0) __pyx_t_18 += __pyx_v_frequency_grids.shape[0]; + if (__pyx_t_19 < 0) __pyx_t_19 += __pyx_v_frequency_grids.shape[1]; + __pyx_t_10 = ((*((__pyx_t_5numpy_float_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_frequency_grids.data + __pyx_t_18 * __pyx_v_frequency_grids.strides[0]) ) + __pyx_t_19 * __pyx_v_frequency_grids.strides[1]) ))) != __pyx_v_missing_freq_val); + if (__pyx_t_10) { /* "fastkde/nufft.pyx":125 * for t in range(ntMax): * if frequency_grids[n,t] != missing_freq_val: * iNotMissing += 1 # <<<<<<<<<<<<<< * if iNotMissing != 0: - * frequencySizes[n] = iNotMissing + * frequencySizes[n] = iNotMissing */ __pyx_v_iNotMissing = (__pyx_v_iNotMissing + 1); @@ -20414,45 +20932,45 @@ static PyArrayObject *__pyx_f_7fastkde_5nufft_nuifft(__Pyx_memviewslice __pyx_v_ * if frequency_grids[n,t] != missing_freq_val: * iNotMissing += 1 * if iNotMissing != 0: # <<<<<<<<<<<<<< - * frequencySizes[n] = iNotMissing + * frequencySizes[n] = iNotMissing * else: */ - __pyx_t_9 = (__pyx_v_iNotMissing != 0); - if (likely(__pyx_t_9)) { + __pyx_t_10 = (__pyx_v_iNotMissing != 0); + if (likely(__pyx_t_10)) { /* "fastkde/nufft.pyx":127 * iNotMissing += 1 * if iNotMissing != 0: - * frequencySizes[n] = iNotMissing # <<<<<<<<<<<<<< + * frequencySizes[n] = iNotMissing # <<<<<<<<<<<<<< * else: * raise ValueError("Some frequencies in frequency_grids have no valid points") */ - __pyx_t_18 = __pyx_v_n; - if (__pyx_t_18 < 0) __pyx_t_18 += __pyx_v_frequencySizes.shape[0]; - *((__pyx_t_5numpy_int_t *) ( /* dim=0 */ (__pyx_v_frequencySizes.data + __pyx_t_18 * __pyx_v_frequencySizes.strides[0]) )) = ((__pyx_t_5numpy_int_t)__pyx_v_iNotMissing); + __pyx_t_19 = __pyx_v_n; + if (__pyx_t_19 < 0) __pyx_t_19 += __pyx_v_frequencySizes.shape[0]; + *((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_frequencySizes.data + __pyx_t_19 * __pyx_v_frequencySizes.strides[0]) )) = ((__pyx_t_5numpy_int64_t)__pyx_v_iNotMissing); /* "fastkde/nufft.pyx":126 * if frequency_grids[n,t] != missing_freq_val: * iNotMissing += 1 * if iNotMissing != 0: # <<<<<<<<<<<<<< - * frequencySizes[n] = iNotMissing + * frequencySizes[n] = iNotMissing * else: */ goto __pyx_L34; } /* "fastkde/nufft.pyx":129 - * frequencySizes[n] = iNotMissing + * frequencySizes[n] = iNotMissing * else: * raise ValueError("Some frequencies in frequency_grids have no valid points") # <<<<<<<<<<<<<< * * #Get the total size of the frequency space */ /*else*/ { - __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 129, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __Pyx_Raise(__pyx_t_10, 0, 0, 0); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_11 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 129, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_Raise(__pyx_t_11, 0, 0, 0); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __PYX_ERR(0, 129, __pyx_L1_error) } __pyx_L34:; @@ -20461,7 +20979,7 @@ static PyArrayObject *__pyx_f_7fastkde_5nufft_nuifft(__Pyx_memviewslice __pyx_v_ /* "fastkde/nufft.pyx":132 * * #Get the total size of the frequency space - * cdef np.int_t freqSpaceSize = np.prod(frequencySizes) # <<<<<<<<<<<<<< + * cdef np.int64_t freqSpaceSize = np.prod(frequencySizes) # <<<<<<<<<<<<<< * * */ @@ -20470,7 +20988,7 @@ static PyArrayObject *__pyx_f_7fastkde_5nufft_nuifft(__Pyx_memviewslice __pyx_v_ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_prod); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 132, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_frequencySizes, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int_t, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 132, __pyx_L1_error) + __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_frequencySizes, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int64_t, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 132, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = NULL; __pyx_t_5 = 0; @@ -20488,16 +21006,16 @@ static PyArrayObject *__pyx_f_7fastkde_5nufft_nuifft(__Pyx_memviewslice __pyx_v_ #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_3}; - __pyx_t_10 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); + __pyx_t_11 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 132, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); + if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 132, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - __pyx_t_19 = __Pyx_PyInt_As_npy_long(__pyx_t_10); if (unlikely((__pyx_t_19 == ((npy_long)-1)) && PyErr_Occurred())) __PYX_ERR(0, 132, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_v_freqSpaceSize = __pyx_t_19; + __pyx_t_20 = __Pyx_PyInt_As_npy_int64(__pyx_t_11); if (unlikely((__pyx_t_20 == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 132, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_v_freqSpaceSize = __pyx_t_20; /* "fastkde/nufft.pyx":137 * @@ -20506,8 +21024,8 @@ static PyArrayObject *__pyx_f_7fastkde_5nufft_nuifft(__Pyx_memviewslice __pyx_v_ * #****************************** * # Calculate the abscissa grids */ - __pyx_t_10 = PyFloat_FromDouble(__pyx_v_missing_freq_val); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 137, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); + __pyx_t_11 = PyFloat_FromDouble(__pyx_v_missing_freq_val); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 137, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 137, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_ones); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 137, __pyx_L1_error) @@ -20517,12 +21035,12 @@ static PyArrayObject *__pyx_f_7fastkde_5nufft_nuifft(__Pyx_memviewslice __pyx_v_ __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_ntMax); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 137, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_20 = PyList_New(2); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 137, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_20); + __pyx_t_21 = PyList_New(2); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 137, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_21); __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyList_SET_ITEM(__pyx_t_20, 0, __pyx_t_3)) __PYX_ERR(0, 137, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_21, 0, __pyx_t_3)) __PYX_ERR(0, 137, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); - if (__Pyx_PyList_SET_ITEM(__pyx_t_20, 1, __pyx_t_4)) __PYX_ERR(0, 137, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_21, 1, __pyx_t_4)) __PYX_ERR(0, 137, __pyx_L1_error); __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_4 = NULL; @@ -20540,23 +21058,23 @@ static PyArrayObject *__pyx_f_7fastkde_5nufft_nuifft(__Pyx_memviewslice __pyx_v_ } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_20}; + PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_21}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; + __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 137, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - __pyx_t_2 = PyNumber_Multiply(__pyx_t_10, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 137, __pyx_L1_error) + __pyx_t_2 = PyNumber_Multiply(__pyx_t_11, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 137, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_21 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float_t(__pyx_t_2, PyBUF_WRITABLE); if (unlikely(!__pyx_t_21.memview)) __PYX_ERR(0, 137, __pyx_L1_error) + __pyx_t_22 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float_t(__pyx_t_2, PyBUF_WRITABLE); if (unlikely(!__pyx_t_22.memview)) __PYX_ERR(0, 137, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_v_abscissaGrids = __pyx_t_21; - __pyx_t_21.memview = NULL; - __pyx_t_21.data = NULL; + __pyx_v_abscissaGrids = __pyx_t_22; + __pyx_t_22.memview = NULL; + __pyx_t_22.data = NULL; /* "fastkde/nufft.pyx":141 * # Calculate the abscissa grids @@ -20567,16 +21085,16 @@ static PyArrayObject *__pyx_f_7fastkde_5nufft_nuifft(__Pyx_memviewslice __pyx_v_ */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_vprint); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 141, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_10 = __Pyx_PyInt_From_int(__pyx_v_be_verbose); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 141, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_20 = NULL; + __pyx_t_11 = __Pyx_PyInt_From_int(__pyx_v_be_verbose); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 141, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_21 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_20 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_20)) { + __pyx_t_21 = PyMethod_GET_SELF(__pyx_t_1); + if (likely(__pyx_t_21)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_20); + __Pyx_INCREF(__pyx_t_21); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_5 = 1; @@ -20584,10 +21102,10 @@ static PyArrayObject *__pyx_f_7fastkde_5nufft_nuifft(__Pyx_memviewslice __pyx_v_ } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_20, __pyx_kp_s_Creating_the_convolution_grid, __pyx_t_10}; + PyObject *__pyx_callargs[3] = {__pyx_t_21, __pyx_kp_s_Creating_the_convolution_grid, __pyx_t_11}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); - __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0; - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 141, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -20601,10 +21119,10 @@ static PyArrayObject *__pyx_f_7fastkde_5nufft_nuifft(__Pyx_memviewslice __pyx_v_ * xdum = calc_x_from_t(frequency_grids[n,:frequencySizes[n]]) * for t in range(frequencySizes[n]): */ - __pyx_t_5 = __pyx_v_numDimensions; - __pyx_t_12 = __pyx_t_5; - for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) { - __pyx_v_n = __pyx_t_13; + __pyx_t_9 = __pyx_v_numDimensions; + __pyx_t_13 = __pyx_t_9; + for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) { + __pyx_v_n = __pyx_t_14; /* "fastkde/nufft.pyx":143 * vprint("Creating the convolution grid",be_verbose) @@ -20615,29 +21133,29 @@ static PyArrayObject *__pyx_f_7fastkde_5nufft_nuifft(__Pyx_memviewslice __pyx_v_ */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_calc_x_from_t); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 143, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_18 = __pyx_v_n; - if (__pyx_t_18 < 0) __pyx_t_18 += __pyx_v_frequencySizes.shape[0]; - __pyx_t_22.data = __pyx_v_frequency_grids.data; - __pyx_t_22.memview = __pyx_v_frequency_grids.memview; - __PYX_INC_MEMVIEW(&__pyx_t_22, 1); + __pyx_t_19 = __pyx_v_n; + if (__pyx_t_19 < 0) __pyx_t_19 += __pyx_v_frequencySizes.shape[0]; + __pyx_t_23.data = __pyx_v_frequency_grids.data; + __pyx_t_23.memview = __pyx_v_frequency_grids.memview; + __PYX_INC_MEMVIEW(&__pyx_t_23, 1); { Py_ssize_t __pyx_tmp_idx = __pyx_v_n; Py_ssize_t __pyx_tmp_shape = __pyx_v_frequency_grids.shape[0]; Py_ssize_t __pyx_tmp_stride = __pyx_v_frequency_grids.strides[0]; if (__pyx_tmp_idx < 0) __pyx_tmp_idx += __pyx_tmp_shape; - __pyx_t_22.data += __pyx_tmp_idx * __pyx_tmp_stride; + __pyx_t_23.data += __pyx_tmp_idx * __pyx_tmp_stride; } -__pyx_t_14 = -1; +__pyx_t_15 = -1; if (unlikely(__pyx_memoryview_slice_memviewslice( - &__pyx_t_22, + &__pyx_t_23, __pyx_v_frequency_grids.shape[1], __pyx_v_frequency_grids.strides[1], __pyx_v_frequency_grids.suboffsets[1], 1, 0, - &__pyx_t_14, + &__pyx_t_15, 0, - (*((__pyx_t_5numpy_int_t *) ( /* dim=0 */ (__pyx_v_frequencySizes.data + __pyx_t_18 * __pyx_v_frequencySizes.strides[0]) ))), + (*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_frequencySizes.data + __pyx_t_19 * __pyx_v_frequencySizes.strides[0]) ))), 0, 0, 1, @@ -20647,29 +21165,29 @@ __pyx_t_14 = -1; __PYX_ERR(0, 143, __pyx_L1_error) } -__pyx_t_10 = __pyx_memoryview_fromslice(__pyx_t_22, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float_t, 0);; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 143, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __PYX_XCLEAR_MEMVIEW(&__pyx_t_22, 1); - __pyx_t_22.memview = NULL; __pyx_t_22.data = NULL; - __pyx_t_20 = NULL; - __pyx_t_14 = 0; +__pyx_t_11 = __pyx_memoryview_fromslice(__pyx_t_23, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float_t, 0);; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 143, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __PYX_XCLEAR_MEMVIEW(&__pyx_t_23, 1); + __pyx_t_23.memview = NULL; __pyx_t_23.data = NULL; + __pyx_t_21 = NULL; + __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_20 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_20)) { + __pyx_t_21 = PyMethod_GET_SELF(__pyx_t_1); + if (likely(__pyx_t_21)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_20); + __Pyx_INCREF(__pyx_t_21); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); - __pyx_t_14 = 1; + __pyx_t_5 = 1; } } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_20, __pyx_t_10}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_14, 1+__pyx_t_14); - __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0; - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + PyObject *__pyx_callargs[2] = {__pyx_t_21, __pyx_t_11}; + __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); + __Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 143, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -20684,12 +21202,12 @@ __pyx_t_10 = __pyx_memoryview_fromslice(__pyx_t_22, 1, (PyObject *(*)(char *)) _ * abscissaGrids[n,t] = xdum[t] * */ - __pyx_t_18 = __pyx_v_n; - if (__pyx_t_18 < 0) __pyx_t_18 += __pyx_v_frequencySizes.shape[0]; - __pyx_t_19 = (*((__pyx_t_5numpy_int_t *) ( /* dim=0 */ (__pyx_v_frequencySizes.data + __pyx_t_18 * __pyx_v_frequencySizes.strides[0]) ))); - __pyx_t_23 = __pyx_t_19; - for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_23; __pyx_t_14+=1) { - __pyx_v_t = __pyx_t_14; + __pyx_t_19 = __pyx_v_n; + if (__pyx_t_19 < 0) __pyx_t_19 += __pyx_v_frequencySizes.shape[0]; + __pyx_t_20 = (*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_frequencySizes.data + __pyx_t_19 * __pyx_v_frequencySizes.strides[0]) ))); + __pyx_t_24 = __pyx_t_20; + for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_24; __pyx_t_15+=1) { + __pyx_v_t = __pyx_t_15; /* "fastkde/nufft.pyx":145 * xdum = calc_x_from_t(frequency_grids[n,:frequencySizes[n]]) @@ -20700,13 +21218,13 @@ __pyx_t_10 = __pyx_memoryview_fromslice(__pyx_t_22, 1, (PyObject *(*)(char *)) _ */ __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_xdum, __pyx_v_t, int, 1, __Pyx_PyInt_From_int, 0, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 145, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_24 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_24 == ((npy_double)-1)) && PyErr_Occurred())) __PYX_ERR(0, 145, __pyx_L1_error) + __pyx_t_25 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_25 == ((npy_double)-1)) && PyErr_Occurred())) __PYX_ERR(0, 145, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_18 = __pyx_v_n; - __pyx_t_17 = __pyx_v_t; - if (__pyx_t_18 < 0) __pyx_t_18 += __pyx_v_abscissaGrids.shape[0]; - if (__pyx_t_17 < 0) __pyx_t_17 += __pyx_v_abscissaGrids.shape[1]; - *((__pyx_t_5numpy_float_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_abscissaGrids.data + __pyx_t_18 * __pyx_v_abscissaGrids.strides[0]) ) + __pyx_t_17 * __pyx_v_abscissaGrids.strides[1]) )) = __pyx_t_24; + __pyx_t_19 = __pyx_v_n; + __pyx_t_18 = __pyx_v_t; + if (__pyx_t_19 < 0) __pyx_t_19 += __pyx_v_abscissaGrids.shape[0]; + if (__pyx_t_18 < 0) __pyx_t_18 += __pyx_v_abscissaGrids.shape[1]; + *((__pyx_t_5numpy_float_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_abscissaGrids.data + __pyx_t_19 * __pyx_v_abscissaGrids.strides[0]) ) + __pyx_t_18 * __pyx_v_abscissaGrids.strides[1]) )) = __pyx_t_25; } } @@ -20719,16 +21237,16 @@ __pyx_t_10 = __pyx_memoryview_fromslice(__pyx_t_22, 1, (PyObject *(*)(char *)) _ */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_vprint); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 151, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_10 = __Pyx_PyInt_From_int(__pyx_v_be_verbose); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 151, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_20 = NULL; + __pyx_t_11 = __Pyx_PyInt_From_int(__pyx_v_be_verbose); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 151, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_21 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_20 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_20)) { + __pyx_t_21 = PyMethod_GET_SELF(__pyx_t_1); + if (likely(__pyx_t_21)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_20); + __Pyx_INCREF(__pyx_t_21); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_5 = 1; @@ -20736,10 +21254,10 @@ __pyx_t_10 = __pyx_memoryview_fromslice(__pyx_t_22, 1, (PyObject *(*)(char *)) _ } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_20, __pyx_kp_s_Initializing_the_convolution, __pyx_t_10}; + PyObject *__pyx_callargs[3] = {__pyx_t_21, __pyx_kp_s_Initializing_the_convolution, __pyx_t_11}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); - __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0; - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 151, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -20753,8 +21271,8 @@ __pyx_t_10 = __pyx_memoryview_fromslice(__pyx_t_22, 1, (PyObject *(*)(char *)) _ * tau = 0.5993 * nspread = 10 */ - __pyx_t_9 = (__pyx_v_precision == 1); - if (__pyx_t_9) { + __pyx_t_10 = (__pyx_v_precision == 1); + if (__pyx_t_10) { /* "fastkde/nufft.pyx":158 * #Set the parameters that control the precision of the nuFFT @@ -20834,8 +21352,8 @@ __pyx_t_10 = __pyx_memoryview_fromslice(__pyx_t_22, 1, (PyObject *(*)(char *)) _ /* "fastkde/nufft.pyx":169 * #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.int64_t,ndim=1] hyperSlabShape = nspread*np.ones([numDimensions],dtype=np.int_) + * cdef np.int64_t [:] hyperSlabShape = nspread*np.ones([numDimensions],dtype=np.int_) # <<<<<<<<<<<<<< * vprint("\tconvolution hyperslab shape: {}".format(hyperSlabShape),be_verbose) * */ @@ -20843,48 +21361,48 @@ __pyx_t_10 = __pyx_memoryview_fromslice(__pyx_t_22, 1, (PyObject *(*)(char *)) _ __Pyx_GOTREF(__pyx_t_2); __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 169, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_ones); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 169, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_ones); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 169, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_numDimensions); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 169, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_20 = PyList_New(1); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 169, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_20); + __pyx_t_21 = PyList_New(1); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 169, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_21); __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyList_SET_ITEM(__pyx_t_20, 0, __pyx_t_1)) __PYX_ERR(0, 169, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_21, 0, __pyx_t_1)) __PYX_ERR(0, 169, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 169, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_GIVEREF(__pyx_t_20); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_20)) __PYX_ERR(0, 169, __pyx_L1_error); - __pyx_t_20 = 0; - __pyx_t_20 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 169, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_20); + __Pyx_GIVEREF(__pyx_t_21); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_21)) __PYX_ERR(0, 169, __pyx_L1_error); + __pyx_t_21 = 0; + __pyx_t_21 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 169, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_21); __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 169, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_int); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 169, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_t_20, __pyx_n_s_dtype, __pyx_t_3) < 0) __PYX_ERR(0, 169, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_21, __pyx_n_s_dtype, __pyx_t_3) < 0) __PYX_ERR(0, 169, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_1, __pyx_t_20); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 169, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_1, __pyx_t_21); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 169, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; - __pyx_t_20 = PyNumber_Multiply(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 169, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_20); + __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0; + __pyx_t_21 = PyNumber_Multiply(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 169, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_21); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int_t(__pyx_t_20, PyBUF_WRITABLE); if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 169, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; - __pyx_v_hyperSlabShape = __pyx_t_11; - __pyx_t_11.memview = NULL; - __pyx_t_11.data = NULL; + __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(__pyx_t_21, PyBUF_WRITABLE); if (unlikely(!__pyx_t_12.memview)) __PYX_ERR(0, 169, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0; + __pyx_v_hyperSlabShape = __pyx_t_12; + __pyx_t_12.memview = NULL; + __pyx_t_12.data = NULL; /* "fastkde/nufft.pyx":170 - * #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.int64_t,ndim=1] hyperSlabShape = nspread*np.ones([numDimensions],dtype=np.int_) + * cdef np.int64_t [:] hyperSlabShape = nspread*np.ones([numDimensions],dtype=np.int_) * vprint("\tconvolution hyperslab shape: {}".format(hyperSlabShape),be_verbose) # <<<<<<<<<<<<<< * * #Calculate the quantities necessary for estimating x-indices @@ -20893,8 +21411,8 @@ __pyx_t_10 = __pyx_memoryview_fromslice(__pyx_t_22, 1, (PyObject *(*)(char *)) _ __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_convolution_hyperslab_shape, __pyx_n_s_format); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 170, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_10 = __pyx_memoryview_fromslice(__pyx_v_hyperSlabShape, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int_t, 0);; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 170, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); + __pyx_t_11 = __pyx_memoryview_fromslice(__pyx_v_hyperSlabShape, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int64_t, 0);; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 170, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS @@ -20910,24 +21428,24 @@ __pyx_t_10 = __pyx_memoryview_fromslice(__pyx_t_22, 1, (PyObject *(*)(char *)) _ } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_10}; + PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_11}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 170, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_be_verbose); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 170, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_10 = NULL; + __pyx_t_11 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_10)) { + __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_11)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_10); + __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; @@ -20935,16 +21453,16 @@ __pyx_t_10 = __pyx_memoryview_fromslice(__pyx_t_22, 1, (PyObject *(*)(char *)) _ } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_10, __pyx_t_2, __pyx_t_1}; - __pyx_t_20 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); - __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + PyObject *__pyx_callargs[3] = {__pyx_t_11, __pyx_t_2, __pyx_t_1}; + __pyx_t_21 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 170, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_20); + if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 170, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_21); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } - __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; + __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0; /* "fastkde/nufft.pyx":174 * #Calculate the quantities necessary for estimating x-indices @@ -20960,15 +21478,15 @@ __pyx_t_10 = __pyx_memoryview_fromslice(__pyx_t_22, 1, (PyObject *(*)(char *)) _ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 174, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = __pyx_v_numDimensions; - __pyx_t_12 = __pyx_t_5; - for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) { - __pyx_v_n = __pyx_t_13; - __pyx_t_17 = __pyx_v_n; - __pyx_t_18 = 0; - if (__pyx_t_17 < 0) __pyx_t_17 += __pyx_v_abscissaGrids.shape[0]; - if (__pyx_t_18 < 0) __pyx_t_18 += __pyx_v_abscissaGrids.shape[1]; - __pyx_t_2 = PyFloat_FromDouble((*((__pyx_t_5numpy_float_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_abscissaGrids.data + __pyx_t_17 * __pyx_v_abscissaGrids.strides[0]) ) + __pyx_t_18 * __pyx_v_abscissaGrids.strides[1]) )))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 174, __pyx_L1_error) + __pyx_t_9 = __pyx_v_numDimensions; + __pyx_t_13 = __pyx_t_9; + for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) { + __pyx_v_n = __pyx_t_14; + __pyx_t_18 = __pyx_v_n; + __pyx_t_19 = 0; + if (__pyx_t_18 < 0) __pyx_t_18 += __pyx_v_abscissaGrids.shape[0]; + if (__pyx_t_19 < 0) __pyx_t_19 += __pyx_v_abscissaGrids.shape[1]; + __pyx_t_2 = PyFloat_FromDouble((*((__pyx_t_5numpy_float_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_abscissaGrids.data + __pyx_t_18 * __pyx_v_abscissaGrids.strides[0]) ) + __pyx_t_19 * __pyx_v_abscissaGrids.strides[1]) )))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 174, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_2))) __PYX_ERR(0, 174, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -20989,18 +21507,18 @@ __pyx_t_10 = __pyx_memoryview_fromslice(__pyx_t_22, 1, (PyObject *(*)(char *)) _ #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_3}; - __pyx_t_20 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); + __pyx_t_21 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 174, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_20); + if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 174, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_21); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - __pyx_t_22 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float_t(__pyx_t_20, PyBUF_WRITABLE); if (unlikely(!__pyx_t_22.memview)) __PYX_ERR(0, 174, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; - __pyx_v_xmins = __pyx_t_22; - __pyx_t_22.memview = NULL; - __pyx_t_22.data = NULL; + __pyx_t_23 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float_t(__pyx_t_21, PyBUF_WRITABLE); if (unlikely(!__pyx_t_23.memview)) __PYX_ERR(0, 174, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0; + __pyx_v_xmins = __pyx_t_23; + __pyx_t_23.memview = NULL; + __pyx_t_23.data = NULL; /* "fastkde/nufft.pyx":176 * xmins = np.array([ abscissaGrids[n,0] for n in range(numDimensions) ]) @@ -21016,19 +21534,19 @@ __pyx_t_10 = __pyx_memoryview_fromslice(__pyx_t_22, 1, (PyObject *(*)(char *)) _ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 176, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __pyx_v_numDimensions; - __pyx_t_12 = __pyx_t_5; - for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) { - __pyx_v_n = __pyx_t_13; - __pyx_t_18 = __pyx_v_n; - __pyx_t_17 = 1; - if (__pyx_t_18 < 0) __pyx_t_18 += __pyx_v_abscissaGrids.shape[0]; - if (__pyx_t_17 < 0) __pyx_t_17 += __pyx_v_abscissaGrids.shape[1]; - __pyx_t_25 = __pyx_v_n; - __pyx_t_26 = 0; - if (__pyx_t_25 < 0) __pyx_t_25 += __pyx_v_abscissaGrids.shape[0]; - if (__pyx_t_26 < 0) __pyx_t_26 += __pyx_v_abscissaGrids.shape[1]; - __pyx_t_2 = PyFloat_FromDouble(((*((__pyx_t_5numpy_float_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_abscissaGrids.data + __pyx_t_18 * __pyx_v_abscissaGrids.strides[0]) ) + __pyx_t_17 * __pyx_v_abscissaGrids.strides[1]) ))) - (*((__pyx_t_5numpy_float_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_abscissaGrids.data + __pyx_t_25 * __pyx_v_abscissaGrids.strides[0]) ) + __pyx_t_26 * __pyx_v_abscissaGrids.strides[1]) ))))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 176, __pyx_L1_error) + __pyx_t_9 = __pyx_v_numDimensions; + __pyx_t_13 = __pyx_t_9; + for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) { + __pyx_v_n = __pyx_t_14; + __pyx_t_19 = __pyx_v_n; + __pyx_t_18 = 1; + if (__pyx_t_19 < 0) __pyx_t_19 += __pyx_v_abscissaGrids.shape[0]; + if (__pyx_t_18 < 0) __pyx_t_18 += __pyx_v_abscissaGrids.shape[1]; + __pyx_t_26 = __pyx_v_n; + __pyx_t_27 = 0; + if (__pyx_t_26 < 0) __pyx_t_26 += __pyx_v_abscissaGrids.shape[0]; + if (__pyx_t_27 < 0) __pyx_t_27 += __pyx_v_abscissaGrids.shape[1]; + __pyx_t_2 = PyFloat_FromDouble(((*((__pyx_t_5numpy_float_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_abscissaGrids.data + __pyx_t_19 * __pyx_v_abscissaGrids.strides[0]) ) + __pyx_t_18 * __pyx_v_abscissaGrids.strides[1]) ))) - (*((__pyx_t_5numpy_float_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_abscissaGrids.data + __pyx_t_26 * __pyx_v_abscissaGrids.strides[0]) ) + __pyx_t_27 * __pyx_v_abscissaGrids.strides[1]) ))))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 176, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_2))) __PYX_ERR(0, 176, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -21049,157 +21567,157 @@ __pyx_t_10 = __pyx_memoryview_fromslice(__pyx_t_22, 1, (PyObject *(*)(char *)) _ #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_1}; - __pyx_t_20 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); + __pyx_t_21 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 176, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_20); + if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 176, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_21); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } - __pyx_t_22 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float_t(__pyx_t_20, PyBUF_WRITABLE); if (unlikely(!__pyx_t_22.memview)) __PYX_ERR(0, 176, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; - __pyx_v_deltaxs = __pyx_t_22; - __pyx_t_22.memview = NULL; - __pyx_t_22.data = NULL; + __pyx_t_23 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float_t(__pyx_t_21, PyBUF_WRITABLE); if (unlikely(!__pyx_t_23.memview)) __PYX_ERR(0, 176, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0; + __pyx_v_deltaxs = __pyx_t_23; + __pyx_t_23.memview = NULL; + __pyx_t_23.data = NULL; /* "fastkde/nufft.pyx":180 * #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.int64_t [:] mvec = np.zeros([numDimensions],dtype=np.int_) # <<<<<<<<<<<<<< + * cdef np.int64_t [:] m0vec = np.zeros([numDimensions],dtype=np.int_) * cdef np.float_t [:] mprimevec = np.zeros([numDimensions]) */ - __Pyx_GetModuleGlobalName(__pyx_t_20, __pyx_n_s_np); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 180, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_20); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_20, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 180, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_21, __pyx_n_s_np); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 180, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_21); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_21, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 180, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; - __pyx_t_20 = __Pyx_PyInt_From_int(__pyx_v_numDimensions); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 180, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_20); + __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0; + __pyx_t_21 = __Pyx_PyInt_From_int(__pyx_v_numDimensions); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 180, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_21); __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 180, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_GIVEREF(__pyx_t_20); - if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_t_20)) __PYX_ERR(0, 180, __pyx_L1_error); - __pyx_t_20 = 0; - __pyx_t_20 = PyTuple_New(1); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 180, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_20); + __Pyx_GIVEREF(__pyx_t_21); + if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_t_21)) __PYX_ERR(0, 180, __pyx_L1_error); + __pyx_t_21 = 0; + __pyx_t_21 = PyTuple_New(1); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 180, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_21); __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_t_1)) __PYX_ERR(0, 180, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_21, 0, __pyx_t_1)) __PYX_ERR(0, 180, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 180, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 180, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_int); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 180, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_int); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 180, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_10) < 0) __PYX_ERR(0, 180, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_20, __pyx_t_1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 180, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_11) < 0) __PYX_ERR(0, 180, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_21, __pyx_t_1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 180, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; + __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int_t(__pyx_t_10, PyBUF_WRITABLE); if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 180, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_v_mvec = __pyx_t_11; - __pyx_t_11.memview = NULL; - __pyx_t_11.data = NULL; + __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(__pyx_t_11, PyBUF_WRITABLE); if (unlikely(!__pyx_t_12.memview)) __PYX_ERR(0, 180, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_v_mvec = __pyx_t_12; + __pyx_t_12.memview = NULL; + __pyx_t_12.data = NULL; /* "fastkde/nufft.pyx":181 * #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.int64_t [:] mvec = np.zeros([numDimensions],dtype=np.int_) + * cdef np.int64_t [:] m0vec = np.zeros([numDimensions],dtype=np.int_) # <<<<<<<<<<<<<< * cdef np.float_t [:] mprimevec = np.zeros([numDimensions]) * cdef np.float_t mprime = 0.0 */ - __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 181, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 181, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_np); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 181, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 181, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = __Pyx_PyInt_From_int(__pyx_v_numDimensions); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 181, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_20 = PyList_New(1); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 181, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_20); - __Pyx_GIVEREF(__pyx_t_10); - if (__Pyx_PyList_SET_ITEM(__pyx_t_20, 0, __pyx_t_10)) __PYX_ERR(0, 181, __pyx_L1_error); - __pyx_t_10 = 0; - __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 181, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __Pyx_GIVEREF(__pyx_t_20); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_20)) __PYX_ERR(0, 181, __pyx_L1_error); - __pyx_t_20 = 0; - __pyx_t_20 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 181, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_20); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_11 = __Pyx_PyInt_From_int(__pyx_v_numDimensions); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 181, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_21 = PyList_New(1); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 181, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_21); + __Pyx_GIVEREF(__pyx_t_11); + if (__Pyx_PyList_SET_ITEM(__pyx_t_21, 0, __pyx_t_11)) __PYX_ERR(0, 181, __pyx_L1_error); + __pyx_t_11 = 0; + __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 181, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_GIVEREF(__pyx_t_21); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_21)) __PYX_ERR(0, 181, __pyx_L1_error); + __pyx_t_21 = 0; + __pyx_t_21 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 181, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_21); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 181, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_int); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 181, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_t_20, __pyx_n_s_dtype, __pyx_t_2) < 0) __PYX_ERR(0, 181, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_21, __pyx_n_s_dtype, __pyx_t_2) < 0) __PYX_ERR(0, 181, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_10, __pyx_t_20); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 181, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_11, __pyx_t_21); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 181, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; - __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int_t(__pyx_t_2, PyBUF_WRITABLE); if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 181, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0; + __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(__pyx_t_2, PyBUF_WRITABLE); if (unlikely(!__pyx_t_12.memview)) __PYX_ERR(0, 181, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_v_m0vec = __pyx_t_11; - __pyx_t_11.memview = NULL; - __pyx_t_11.data = NULL; + __pyx_v_m0vec = __pyx_t_12; + __pyx_t_12.memview = NULL; + __pyx_t_12.data = NULL; /* "fastkde/nufft.pyx":182 - * cdef np.int_t [:] mvec = np.zeros([numDimensions],dtype=np.int_) - * cdef np.int_t [:] m0vec = np.zeros([numDimensions],dtype=np.int_) + * cdef np.int64_t [:] mvec = np.zeros([numDimensions],dtype=np.int_) + * cdef np.int64_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 */ - __Pyx_GetModuleGlobalName(__pyx_t_20, __pyx_n_s_np); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 182, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_20); - __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_20, __pyx_n_s_zeros); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 182, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; - __pyx_t_20 = __Pyx_PyInt_From_int(__pyx_v_numDimensions); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 182, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_20); + __Pyx_GetModuleGlobalName(__pyx_t_21, __pyx_n_s_np); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 182, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_21); + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_21, __pyx_n_s_zeros); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 182, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0; + __pyx_t_21 = __Pyx_PyInt_From_int(__pyx_v_numDimensions); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 182, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_21); __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 182, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_GIVEREF(__pyx_t_20); - if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_t_20)) __PYX_ERR(0, 182, __pyx_L1_error); - __pyx_t_20 = 0; - __pyx_t_20 = NULL; + __Pyx_GIVEREF(__pyx_t_21); + if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_t_21)) __PYX_ERR(0, 182, __pyx_L1_error); + __pyx_t_21 = 0; + __pyx_t_21 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_10))) { - __pyx_t_20 = PyMethod_GET_SELF(__pyx_t_10); - if (likely(__pyx_t_20)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); - __Pyx_INCREF(__pyx_t_20); + if (unlikely(PyMethod_Check(__pyx_t_11))) { + __pyx_t_21 = PyMethod_GET_SELF(__pyx_t_11); + if (likely(__pyx_t_21)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11); + __Pyx_INCREF(__pyx_t_21); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_10, function); + __Pyx_DECREF_SET(__pyx_t_11, function); __pyx_t_5 = 1; } } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_20, __pyx_t_1}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); - __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0; + PyObject *__pyx_callargs[2] = {__pyx_t_21, __pyx_t_1}; + __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_11, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); + __Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 182, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } - __pyx_t_22 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float_t(__pyx_t_2, PyBUF_WRITABLE); if (unlikely(!__pyx_t_22.memview)) __PYX_ERR(0, 182, __pyx_L1_error) + __pyx_t_23 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float_t(__pyx_t_2, PyBUF_WRITABLE); if (unlikely(!__pyx_t_23.memview)) __PYX_ERR(0, 182, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_v_mprimevec = __pyx_t_22; - __pyx_t_22.memview = NULL; - __pyx_t_22.data = NULL; + __pyx_v_mprimevec = __pyx_t_23; + __pyx_t_23.memview = NULL; + __pyx_t_23.data = NULL; /* "fastkde/nufft.pyx":183 - * cdef np.int_t [:] m0vec = np.zeros([numDimensions],dtype=np.int_) + * cdef np.int64_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 @@ -21246,10 +21764,10 @@ __pyx_t_10 = __pyx_memoryview_fromslice(__pyx_t_22, 1, (PyObject *(*)(char *)) _ */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 190, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 190, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 190, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyInt_From_npy_long(__pyx_v_freqSpaceSize); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 190, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_npy_int64(__pyx_v_freqSpaceSize); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 190, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 190, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); @@ -21263,23 +21781,23 @@ __pyx_t_10 = __pyx_memoryview_fromslice(__pyx_t_22, 1, (PyObject *(*)(char *)) _ __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 190, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_GetModuleGlobalName(__pyx_t_20, __pyx_n_s_np); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 190, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_20); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_20, __pyx_n_s_complex128); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 190, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_21, __pyx_n_s_np); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 190, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_21); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_21, __pyx_n_s_complex128); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 190, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; + __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0; if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_3) < 0) __PYX_ERR(0, 190, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 190, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 190, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_27 = __Pyx_PyObject_to_MemoryviewSlice_ds___pyx_t_double_complex(__pyx_t_3, PyBUF_WRITABLE); if (unlikely(!__pyx_t_27.memview)) __PYX_ERR(0, 190, __pyx_L1_error) + __pyx_t_28 = __Pyx_PyObject_to_MemoryviewSlice_ds___pyx_t_double_complex(__pyx_t_3, PyBUF_WRITABLE); if (unlikely(!__pyx_t_28.memview)) __PYX_ERR(0, 190, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_v_convolvedData = __pyx_t_27; - __pyx_t_27.memview = NULL; - __pyx_t_27.data = NULL; + __pyx_v_convolvedData = __pyx_t_28; + __pyx_t_28.memview = NULL; + __pyx_t_28.data = NULL; /* "fastkde/nufft.pyx":196 * # Convolve the data with a gaussian @@ -21292,14 +21810,14 @@ __pyx_t_10 = __pyx_memoryview_fromslice(__pyx_t_22, 1, (PyObject *(*)(char *)) _ __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_be_verbose); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 196, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_10 = NULL; + __pyx_t_11 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_10)) { + __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_1); + if (likely(__pyx_t_11)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_10); + __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_5 = 1; @@ -21307,9 +21825,9 @@ __pyx_t_10 = __pyx_memoryview_fromslice(__pyx_t_22, 1, (PyObject *(*)(char *)) _ } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_10, __pyx_kp_s_Performing_the_convolution, __pyx_t_2}; + PyObject *__pyx_callargs[3] = {__pyx_t_11, __pyx_kp_s_Performing_the_convolution, __pyx_t_2}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); - __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 196, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); @@ -21340,10 +21858,10 @@ __pyx_t_10 = __pyx_memoryview_fromslice(__pyx_t_22, 1, (PyObject *(*)(char *)) _ * * #Transform the coordinates of our current abscissas value */ - __pyx_t_5 = __pyx_v_numDataPoints; - __pyx_t_12 = __pyx_t_5; - for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) { - __pyx_v_j = __pyx_t_13; + __pyx_t_9 = __pyx_v_numDataPoints; + __pyx_t_13 = __pyx_t_9; + for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) { + __pyx_v_j = __pyx_t_14; /* "fastkde/nufft.pyx":203 * #into the coordinate system of a hyperslab centered on the nearest @@ -21352,10 +21870,10 @@ __pyx_t_10 = __pyx_memoryview_fromslice(__pyx_t_22, 1, (PyObject *(*)(char *)) _ * #Transform the current abscissa value into an approximate * #grid value */ - __pyx_t_14 = __pyx_v_numDimensions; - __pyx_t_15 = __pyx_t_14; - for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) { - __pyx_v_v = __pyx_t_16; + __pyx_t_15 = __pyx_v_numDimensions; + __pyx_t_16 = __pyx_t_15; + for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) { + __pyx_v_v = __pyx_t_17; /* "fastkde/nufft.pyx":206 * #Transform the current abscissa value into an approximate @@ -21364,17 +21882,17 @@ __pyx_t_10 = __pyx_memoryview_fromslice(__pyx_t_22, 1, (PyObject *(*)(char *)) _ * #Calculate the nearest (in the floor sense) grid abscissa * m0vec[v] = floor(mprime) */ - __pyx_t_26 = __pyx_v_v; - __pyx_t_25 = __pyx_v_j; - if (__pyx_t_26 < 0) __pyx_t_26 += __pyx_v_abscissas.shape[0]; - if (__pyx_t_25 < 0) __pyx_t_25 += __pyx_v_abscissas.shape[1]; - __pyx_t_17 = __pyx_v_v; - if (__pyx_t_17 < 0) __pyx_t_17 += __pyx_v_xmins.shape[0]; - __pyx_t_24 = ((*((__pyx_t_5numpy_float_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_abscissas.data + __pyx_t_26 * __pyx_v_abscissas.strides[0]) ) + __pyx_t_25 * __pyx_v_abscissas.strides[1]) ))) - (*((__pyx_t_5numpy_float_t *) ( /* dim=0 */ (__pyx_v_xmins.data + __pyx_t_17 * __pyx_v_xmins.strides[0]) )))); - __pyx_t_17 = __pyx_v_v; - if (__pyx_t_17 < 0) __pyx_t_17 += __pyx_v_deltaxs.shape[0]; - __pyx_t_28 = (*((__pyx_t_5numpy_float_t *) ( /* dim=0 */ (__pyx_v_deltaxs.data + __pyx_t_17 * __pyx_v_deltaxs.strides[0]) ))); - if (unlikely(__pyx_t_28 == 0)) { + __pyx_t_27 = __pyx_v_v; + __pyx_t_26 = __pyx_v_j; + if (__pyx_t_27 < 0) __pyx_t_27 += __pyx_v_abscissas.shape[0]; + if (__pyx_t_26 < 0) __pyx_t_26 += __pyx_v_abscissas.shape[1]; + __pyx_t_18 = __pyx_v_v; + if (__pyx_t_18 < 0) __pyx_t_18 += __pyx_v_xmins.shape[0]; + __pyx_t_25 = ((*((__pyx_t_5numpy_float_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_abscissas.data + __pyx_t_27 * __pyx_v_abscissas.strides[0]) ) + __pyx_t_26 * __pyx_v_abscissas.strides[1]) ))) - (*((__pyx_t_5numpy_float_t *) ( /* dim=0 */ (__pyx_v_xmins.data + __pyx_t_18 * __pyx_v_xmins.strides[0]) )))); + __pyx_t_18 = __pyx_v_v; + if (__pyx_t_18 < 0) __pyx_t_18 += __pyx_v_deltaxs.shape[0]; + __pyx_t_29 = (*((__pyx_t_5numpy_float_t *) ( /* dim=0 */ (__pyx_v_deltaxs.data + __pyx_t_18 * __pyx_v_deltaxs.strides[0]) ))); + if (unlikely(__pyx_t_29 == 0)) { #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif @@ -21384,7 +21902,7 @@ __pyx_t_10 = __pyx_memoryview_fromslice(__pyx_t_22, 1, (PyObject *(*)(char *)) _ #endif __PYX_ERR(0, 206, __pyx_L45_error) } - __pyx_v_mprime = (__pyx_t_24 / __pyx_t_28); + __pyx_v_mprime = (__pyx_t_25 / __pyx_t_29); /* "fastkde/nufft.pyx":208 * mprime = (abscissas[v,j] - xmins[v])/deltaxs[v] @@ -21393,9 +21911,9 @@ __pyx_t_10 = __pyx_memoryview_fromslice(__pyx_t_22, 1, (PyObject *(*)(char *)) _ * #Finish transforming the absicssa value to hyperslab coordinates * mprimevec[v] = mprime - m0vec[v] + nspreadhalf */ - __pyx_t_17 = __pyx_v_v; - if (__pyx_t_17 < 0) __pyx_t_17 += __pyx_v_m0vec.shape[0]; - *((__pyx_t_5numpy_int_t *) ( /* dim=0 */ (__pyx_v_m0vec.data + __pyx_t_17 * __pyx_v_m0vec.strides[0]) )) = ((long)floor(__pyx_v_mprime)); + __pyx_t_18 = __pyx_v_v; + if (__pyx_t_18 < 0) __pyx_t_18 += __pyx_v_m0vec.shape[0]; + *((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_m0vec.data + __pyx_t_18 * __pyx_v_m0vec.strides[0]) )) = ((long)floor(__pyx_v_mprime)); /* "fastkde/nufft.pyx":210 * m0vec[v] = floor(mprime) @@ -21404,11 +21922,11 @@ __pyx_t_10 = __pyx_memoryview_fromslice(__pyx_t_22, 1, (PyObject *(*)(char *)) _ * * #Cycle over all the hyperslab points and calculate the gaussian convolution */ - __pyx_t_17 = __pyx_v_v; - if (__pyx_t_17 < 0) __pyx_t_17 += __pyx_v_m0vec.shape[0]; - __pyx_t_25 = __pyx_v_v; - if (__pyx_t_25 < 0) __pyx_t_25 += __pyx_v_mprimevec.shape[0]; - *((__pyx_t_5numpy_float_t *) ( /* dim=0 */ (__pyx_v_mprimevec.data + __pyx_t_25 * __pyx_v_mprimevec.strides[0]) )) = ((__pyx_v_mprime - (*((__pyx_t_5numpy_int_t *) ( /* dim=0 */ (__pyx_v_m0vec.data + __pyx_t_17 * __pyx_v_m0vec.strides[0]) )))) + __pyx_v_nspreadhalf); + __pyx_t_18 = __pyx_v_v; + if (__pyx_t_18 < 0) __pyx_t_18 += __pyx_v_m0vec.shape[0]; + __pyx_t_26 = __pyx_v_v; + if (__pyx_t_26 < 0) __pyx_t_26 += __pyx_v_mprimevec.shape[0]; + *((__pyx_t_5numpy_float_t *) ( /* dim=0 */ (__pyx_v_mprimevec.data + __pyx_t_26 * __pyx_v_mprimevec.strides[0]) )) = ((__pyx_v_mprime - (*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_m0vec.data + __pyx_t_18 * __pyx_v_m0vec.strides[0]) )))) + __pyx_v_nspreadhalf); } /* "fastkde/nufft.pyx":214 @@ -21418,10 +21936,10 @@ __pyx_t_10 = __pyx_memoryview_fromslice(__pyx_t_22, 1, (PyObject *(*)(char *)) _ * #Get the indices (mvec) of the current point (i) in our hyperslab * unravelIndex(i,hyperSlabShape,mvec,numDimensions) */ - __pyx_t_29 = __pyx_v_hyperSlabSize; - __pyx_t_30 = __pyx_t_29; - for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_30; __pyx_t_14+=1) { - __pyx_v_i = __pyx_t_14; + __pyx_t_30 = __pyx_v_hyperSlabSize; + __pyx_t_31 = __pyx_t_30; + for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_31; __pyx_t_15+=1) { + __pyx_v_i = __pyx_t_15; /* "fastkde/nufft.pyx":216 * for i in range(hyperSlabSize): @@ -21430,7 +21948,7 @@ __pyx_t_10 = __pyx_memoryview_fromslice(__pyx_t_22, 1, (PyObject *(*)(char *)) _ * * gaussArg = 0.0 */ - __pyx_t_15 = __pyx_f_7fastkde_5nufft_unravelIndex(__pyx_v_i, __pyx_v_hyperSlabShape, __pyx_v_mvec, __pyx_v_numDimensions); if (unlikely(__pyx_t_15 == ((int)-1) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 216, __pyx_L45_error) + __pyx_t_16 = __pyx_f_7fastkde_5nufft_unravelIndex(__pyx_v_i, __pyx_v_hyperSlabShape, __pyx_v_mvec, __pyx_v_numDimensions); if (unlikely(__pyx_t_16 == ((int)-1) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 216, __pyx_L45_error) /* "fastkde/nufft.pyx":218 * unravelIndex(i,hyperSlabShape,mvec,numDimensions) @@ -21448,10 +21966,10 @@ __pyx_t_10 = __pyx_memoryview_fromslice(__pyx_t_22, 1, (PyObject *(*)(char *)) _ * #Calculate the distance between the data point and the current * #hyperslab point */ - __pyx_t_15 = __pyx_v_numDimensions; - __pyx_t_16 = __pyx_t_15; - for (__pyx_t_31 = 0; __pyx_t_31 < __pyx_t_16; __pyx_t_31+=1) { - __pyx_v_v = __pyx_t_31; + __pyx_t_16 = __pyx_v_numDimensions; + __pyx_t_17 = __pyx_t_16; + for (__pyx_t_32 = 0; __pyx_t_32 < __pyx_t_17; __pyx_t_32+=1) { + __pyx_v_v = __pyx_t_32; /* "fastkde/nufft.pyx":222 * #Calculate the distance between the data point and the current @@ -21460,11 +21978,11 @@ __pyx_t_10 = __pyx_memoryview_fromslice(__pyx_t_22, 1, (PyObject *(*)(char *)) _ * #Transform from hyperslab coordinates back to full space coordinates * mvec[v] = (mvec[v] + m0vec[v]) - nspreadhalf */ - __pyx_t_17 = __pyx_v_v; - if (__pyx_t_17 < 0) __pyx_t_17 += __pyx_v_mvec.shape[0]; - __pyx_t_25 = __pyx_v_v; - if (__pyx_t_25 < 0) __pyx_t_25 += __pyx_v_mprimevec.shape[0]; - __pyx_v_gaussArg = (__pyx_v_gaussArg + pow((((__pyx_t_5numpy_float_t)(*((__pyx_t_5numpy_int_t *) ( /* dim=0 */ (__pyx_v_mvec.data + __pyx_t_17 * __pyx_v_mvec.strides[0]) )))) - (*((__pyx_t_5numpy_float_t *) ( /* dim=0 */ (__pyx_v_mprimevec.data + __pyx_t_25 * __pyx_v_mprimevec.strides[0]) )))), 2.0)); + __pyx_t_18 = __pyx_v_v; + if (__pyx_t_18 < 0) __pyx_t_18 += __pyx_v_mvec.shape[0]; + __pyx_t_26 = __pyx_v_v; + if (__pyx_t_26 < 0) __pyx_t_26 += __pyx_v_mprimevec.shape[0]; + __pyx_v_gaussArg = (__pyx_v_gaussArg + pow((((__pyx_t_5numpy_float_t)(*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_mvec.data + __pyx_t_18 * __pyx_v_mvec.strides[0]) )))) - (*((__pyx_t_5numpy_float_t *) ( /* dim=0 */ (__pyx_v_mprimevec.data + __pyx_t_26 * __pyx_v_mprimevec.strides[0]) )))), 2.0)); /* "fastkde/nufft.pyx":224 * gaussArg = gaussArg + (mvec[v] - mprimevec[v])**2 @@ -21473,13 +21991,13 @@ __pyx_t_10 = __pyx_memoryview_fromslice(__pyx_t_22, 1, (PyObject *(*)(char *)) _ * #Calculate the gaussian of this distance * gaussTerm = ordinates[j]*( exp(-gaussArg/fourTau)) */ - __pyx_t_25 = __pyx_v_v; - if (__pyx_t_25 < 0) __pyx_t_25 += __pyx_v_mvec.shape[0]; - __pyx_t_17 = __pyx_v_v; - if (__pyx_t_17 < 0) __pyx_t_17 += __pyx_v_m0vec.shape[0]; __pyx_t_26 = __pyx_v_v; if (__pyx_t_26 < 0) __pyx_t_26 += __pyx_v_mvec.shape[0]; - *((__pyx_t_5numpy_int_t *) ( /* dim=0 */ (__pyx_v_mvec.data + __pyx_t_26 * __pyx_v_mvec.strides[0]) )) = (((*((__pyx_t_5numpy_int_t *) ( /* dim=0 */ (__pyx_v_mvec.data + __pyx_t_25 * __pyx_v_mvec.strides[0]) ))) + (*((__pyx_t_5numpy_int_t *) ( /* dim=0 */ (__pyx_v_m0vec.data + __pyx_t_17 * __pyx_v_m0vec.strides[0]) )))) - __pyx_v_nspreadhalf); + __pyx_t_18 = __pyx_v_v; + if (__pyx_t_18 < 0) __pyx_t_18 += __pyx_v_m0vec.shape[0]; + __pyx_t_27 = __pyx_v_v; + if (__pyx_t_27 < 0) __pyx_t_27 += __pyx_v_mvec.shape[0]; + *((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_mvec.data + __pyx_t_27 * __pyx_v_mvec.strides[0]) )) = (((*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_mvec.data + __pyx_t_26 * __pyx_v_mvec.strides[0]) ))) + (*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_m0vec.data + __pyx_t_18 * __pyx_v_m0vec.strides[0]) )))) - __pyx_v_nspreadhalf); } /* "fastkde/nufft.pyx":226 @@ -21489,9 +22007,9 @@ __pyx_t_10 = __pyx_memoryview_fromslice(__pyx_t_22, 1, (PyObject *(*)(char *)) _ * * #Calculate the flattened array index of the current point */ - __pyx_t_17 = __pyx_v_j; - if (__pyx_t_17 < 0) __pyx_t_17 += __pyx_v_ordinates.shape[0]; - __pyx_t_28 = (-__pyx_v_gaussArg); + __pyx_t_18 = __pyx_v_j; + if (__pyx_t_18 < 0) __pyx_t_18 += __pyx_v_ordinates.shape[0]; + __pyx_t_29 = (-__pyx_v_gaussArg); if (unlikely(__pyx_v_fourTau == 0)) { #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); @@ -21502,7 +22020,7 @@ __pyx_t_10 = __pyx_memoryview_fromslice(__pyx_t_22, 1, (PyObject *(*)(char *)) _ #endif __PYX_ERR(0, 226, __pyx_L45_error) } - __pyx_v_gaussTerm = __Pyx_c_prod_double((*((__pyx_t_double_complex *) ( /* dim=0 */ (__pyx_v_ordinates.data + __pyx_t_17 * __pyx_v_ordinates.strides[0]) ))), __pyx_t_double_complex_from_parts(((double)exp((__pyx_t_28 / __pyx_v_fourTau))), 0)); + __pyx_v_gaussTerm = __Pyx_c_prod_double((*((__pyx_t_double_complex *) ( /* dim=0 */ (__pyx_v_ordinates.data + __pyx_t_18 * __pyx_v_ordinates.strides[0]) ))), __pyx_t_double_complex_from_parts(((double)exp((__pyx_t_29 / __pyx_v_fourTau))), 0)); /* "fastkde/nufft.pyx":229 * @@ -21511,8 +22029,8 @@ __pyx_t_10 = __pyx_memoryview_fromslice(__pyx_t_22, 1, (PyObject *(*)(char *)) _ * * #Add the gaussian term to this point (only if it is within our domain */ - __pyx_t_15 = __pyx_f_7fastkde_5nufft_ravelIndex(__pyx_v_frequencySizes, __pyx_v_mvec, __pyx_v_numDimensions); if (unlikely(__pyx_t_15 == ((int)-1) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 229, __pyx_L45_error) - __pyx_v_k = __pyx_t_15; + __pyx_t_16 = __pyx_f_7fastkde_5nufft_ravelIndex(__pyx_v_frequencySizes, __pyx_v_mvec, __pyx_v_numDimensions); if (unlikely(__pyx_t_16 == ((int)-1) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 229, __pyx_L45_error) + __pyx_v_k = __pyx_t_16; /* "fastkde/nufft.pyx":232 * @@ -21521,16 +22039,16 @@ __pyx_t_10 = __pyx_memoryview_fromslice(__pyx_t_22, 1, (PyObject *(*)(char *)) _ * convolvedData[k] = convolvedData[k] + gaussTerm * */ - __pyx_t_32 = (__pyx_v_k >= 0); - if (__pyx_t_32) { + __pyx_t_33 = (__pyx_v_k >= 0); + if (__pyx_t_33) { } else { - __pyx_t_9 = __pyx_t_32; + __pyx_t_10 = __pyx_t_33; goto __pyx_L56_bool_binop_done; } - __pyx_t_32 = (__pyx_v_k < __pyx_v_freqSpaceSize); - __pyx_t_9 = __pyx_t_32; + __pyx_t_33 = (__pyx_v_k < __pyx_v_freqSpaceSize); + __pyx_t_10 = __pyx_t_33; __pyx_L56_bool_binop_done:; - if (__pyx_t_9) { + if (__pyx_t_10) { /* "fastkde/nufft.pyx":233 * #Add the gaussian term to this point (only if it is within our domain @@ -21539,11 +22057,11 @@ __pyx_t_10 = __pyx_memoryview_fromslice(__pyx_t_22, 1, (PyObject *(*)(char *)) _ * * #Take its FFT */ - __pyx_t_17 = __pyx_v_k; - if (__pyx_t_17 < 0) __pyx_t_17 += __pyx_v_convolvedData.shape[0]; - __pyx_t_25 = __pyx_v_k; - if (__pyx_t_25 < 0) __pyx_t_25 += __pyx_v_convolvedData.shape[0]; - *((__pyx_t_double_complex *) ( /* dim=0 */ (__pyx_v_convolvedData.data + __pyx_t_25 * __pyx_v_convolvedData.strides[0]) )) = __Pyx_c_sum_double((*((__pyx_t_double_complex *) ( /* dim=0 */ (__pyx_v_convolvedData.data + __pyx_t_17 * __pyx_v_convolvedData.strides[0]) ))), __pyx_v_gaussTerm); + __pyx_t_18 = __pyx_v_k; + if (__pyx_t_18 < 0) __pyx_t_18 += __pyx_v_convolvedData.shape[0]; + __pyx_t_26 = __pyx_v_k; + if (__pyx_t_26 < 0) __pyx_t_26 += __pyx_v_convolvedData.shape[0]; + *((__pyx_t_double_complex *) ( /* dim=0 */ (__pyx_v_convolvedData.data + __pyx_t_26 * __pyx_v_convolvedData.strides[0]) )) = __Pyx_c_sum_double((*((__pyx_t_double_complex *) ( /* dim=0 */ (__pyx_v_convolvedData.data + __pyx_t_18 * __pyx_v_convolvedData.strides[0]) ))), __pyx_v_gaussTerm); /* "fastkde/nufft.pyx":232 * @@ -21594,14 +22112,14 @@ __pyx_t_10 = __pyx_memoryview_fromslice(__pyx_t_22, 1, (PyObject *(*)(char *)) _ __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_be_verbose); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_10 = NULL; + __pyx_t_11 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_10)) { + __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_1); + if (likely(__pyx_t_11)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_10); + __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_5 = 1; @@ -21609,9 +22127,9 @@ __pyx_t_10 = __pyx_memoryview_fromslice(__pyx_t_22, 1, (PyObject *(*)(char *)) _ } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_10, __pyx_kp_s_Raveling_and_doing_FFT_on_convol, __pyx_t_2}; + PyObject *__pyx_callargs[3] = {__pyx_t_11, __pyx_kp_s_Raveling_and_doing_FFT_on_convol, __pyx_t_2}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); - __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); @@ -21631,103 +22149,103 @@ __pyx_t_10 = __pyx_memoryview_fromslice(__pyx_t_22, 1, (PyObject *(*)(char *)) _ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_fftshift); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_fft); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 241, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_20 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_ifftn); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 241, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_20); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_fft); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 241, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_21 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_ifftn); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 241, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_21); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_fft); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_33 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_ifftshift); if (unlikely(!__pyx_t_33)) __PYX_ERR(0, 241, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_33); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_34, __pyx_n_s_np); if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 241, __pyx_L1_error) + __pyx_t_34 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_ifftshift); if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_34); - __pyx_t_35 = __Pyx_PyObject_GetAttrStr(__pyx_t_34, __pyx_n_s_reshape); if (unlikely(!__pyx_t_35)) __PYX_ERR(0, 241, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_35, __pyx_n_s_np); if (unlikely(!__pyx_t_35)) __PYX_ERR(0, 241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_35); - __Pyx_DECREF(__pyx_t_34); __pyx_t_34 = 0; - __pyx_t_34 = __pyx_memoryview_fromslice(__pyx_v_convolvedData, 1, (PyObject *(*)(char *)) __pyx_memview_get___pyx_t_double_complex, (int (*)(char *, PyObject *)) __pyx_memview_set___pyx_t_double_complex, 0);; if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 241, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_34); - __pyx_t_36 = __pyx_memoryview_fromslice(__pyx_v_frequencySizes, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int_t, 0);; if (unlikely(!__pyx_t_36)) __PYX_ERR(0, 241, __pyx_L1_error) + __pyx_t_36 = __Pyx_PyObject_GetAttrStr(__pyx_t_35, __pyx_n_s_reshape); if (unlikely(!__pyx_t_36)) __PYX_ERR(0, 241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_36); - __pyx_t_37 = NULL; + __Pyx_DECREF(__pyx_t_35); __pyx_t_35 = 0; + __pyx_t_35 = __pyx_memoryview_fromslice(__pyx_v_convolvedData, 1, (PyObject *(*)(char *)) __pyx_memview_get___pyx_t_double_complex, (int (*)(char *, PyObject *)) __pyx_memview_set___pyx_t_double_complex, 0);; if (unlikely(!__pyx_t_35)) __PYX_ERR(0, 241, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_35); + __pyx_t_37 = __pyx_memoryview_fromslice(__pyx_v_frequencySizes, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int64_t, 0);; if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 241, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_37); + __pyx_t_38 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_35))) { - __pyx_t_37 = PyMethod_GET_SELF(__pyx_t_35); - if (likely(__pyx_t_37)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_35); - __Pyx_INCREF(__pyx_t_37); + if (unlikely(PyMethod_Check(__pyx_t_36))) { + __pyx_t_38 = PyMethod_GET_SELF(__pyx_t_36); + if (likely(__pyx_t_38)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_36); + __Pyx_INCREF(__pyx_t_38); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_35, function); + __Pyx_DECREF_SET(__pyx_t_36, function); __pyx_t_5 = 1; } } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_37, __pyx_t_34, __pyx_t_36}; - __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_35, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); - __Pyx_XDECREF(__pyx_t_37); __pyx_t_37 = 0; - __Pyx_DECREF(__pyx_t_34); __pyx_t_34 = 0; - __Pyx_DECREF(__pyx_t_36); __pyx_t_36 = 0; + PyObject *__pyx_callargs[3] = {__pyx_t_38, __pyx_t_35, __pyx_t_37}; + __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_36, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); + __Pyx_XDECREF(__pyx_t_38); __pyx_t_38 = 0; + __Pyx_DECREF(__pyx_t_35); __pyx_t_35 = 0; + __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_35); __pyx_t_35 = 0; + __Pyx_DECREF(__pyx_t_36); __pyx_t_36 = 0; } - __pyx_t_35 = NULL; + __pyx_t_36 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_33))) { - __pyx_t_35 = PyMethod_GET_SELF(__pyx_t_33); - if (likely(__pyx_t_35)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_33); - __Pyx_INCREF(__pyx_t_35); + if (unlikely(PyMethod_Check(__pyx_t_34))) { + __pyx_t_36 = PyMethod_GET_SELF(__pyx_t_34); + if (likely(__pyx_t_36)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_34); + __Pyx_INCREF(__pyx_t_36); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_33, function); + __Pyx_DECREF_SET(__pyx_t_34, function); __pyx_t_5 = 1; } } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_35, __pyx_t_4}; - __pyx_t_10 = __Pyx_PyObject_FastCall(__pyx_t_33, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); - __Pyx_XDECREF(__pyx_t_35); __pyx_t_35 = 0; + PyObject *__pyx_callargs[2] = {__pyx_t_36, __pyx_t_4}; + __pyx_t_11 = __Pyx_PyObject_FastCall(__pyx_t_34, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); + __Pyx_XDECREF(__pyx_t_36); __pyx_t_36 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 241, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __Pyx_DECREF(__pyx_t_33); __pyx_t_33 = 0; + if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 241, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_34); __pyx_t_34 = 0; } - __pyx_t_33 = NULL; + __pyx_t_34 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_20))) { - __pyx_t_33 = PyMethod_GET_SELF(__pyx_t_20); - if (likely(__pyx_t_33)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_20); - __Pyx_INCREF(__pyx_t_33); + if (unlikely(PyMethod_Check(__pyx_t_21))) { + __pyx_t_34 = PyMethod_GET_SELF(__pyx_t_21); + if (likely(__pyx_t_34)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_21); + __Pyx_INCREF(__pyx_t_34); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_20, function); + __Pyx_DECREF_SET(__pyx_t_21, function); __pyx_t_5 = 1; } } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_33, __pyx_t_10}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_20, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); - __Pyx_XDECREF(__pyx_t_33); __pyx_t_33 = 0; - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + PyObject *__pyx_callargs[2] = {__pyx_t_34, __pyx_t_11}; + __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_21, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); + __Pyx_XDECREF(__pyx_t_34); __pyx_t_34 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; + __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0; } - __pyx_t_20 = NULL; + __pyx_t_21 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_20 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_20)) { + __pyx_t_21 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_21)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_20); + __Pyx_INCREF(__pyx_t_21); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; @@ -21735,9 +22253,9 @@ __pyx_t_10 = __pyx_memoryview_fromslice(__pyx_t_22, 1, (PyObject *(*)(char *)) _ } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_20, __pyx_t_1}; + PyObject *__pyx_callargs[2] = {__pyx_t_21, __pyx_t_1}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); - __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0; + __Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); @@ -21755,21 +22273,21 @@ __pyx_t_10 = __pyx_memoryview_fromslice(__pyx_t_22, 1, (PyObject *(*)(char *)) _ */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_vprint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_20 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_shape_convolvedFFT, __pyx_n_s_format); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 242, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_20); - __Pyx_GetModuleGlobalName(__pyx_t_33, __pyx_n_s_np); if (unlikely(!__pyx_t_33)) __PYX_ERR(0, 242, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_33); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_33, __pyx_n_s_shape); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 242, __pyx_L1_error) + __pyx_t_21 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_shape_convolvedFFT, __pyx_n_s_format); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 242, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_21); + __Pyx_GetModuleGlobalName(__pyx_t_34, __pyx_n_s_np); if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 242, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_34); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_34, __pyx_n_s_shape); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_33); __pyx_t_33 = 0; - __pyx_t_33 = NULL; + __Pyx_DECREF(__pyx_t_34); __pyx_t_34 = 0; + __pyx_t_34 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_33 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_33)) { + __pyx_t_34 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_34)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_33); + __Pyx_INCREF(__pyx_t_34); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; @@ -21777,46 +22295,46 @@ __pyx_t_10 = __pyx_memoryview_fromslice(__pyx_t_22, 1, (PyObject *(*)(char *)) _ } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_33, __pyx_v_convolvedFFT}; - __pyx_t_10 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); - __Pyx_XDECREF(__pyx_t_33); __pyx_t_33 = 0; - if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 242, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); + PyObject *__pyx_callargs[2] = {__pyx_t_34, __pyx_v_convolvedFFT}; + __pyx_t_11 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); + __Pyx_XDECREF(__pyx_t_34); __pyx_t_34 = 0; + if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 242, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_20))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_20); + if (likely(PyMethod_Check(__pyx_t_21))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_21); if (likely(__pyx_t_4)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_20); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_21); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_20, function); + __Pyx_DECREF_SET(__pyx_t_21, function); __pyx_t_5 = 1; } } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_10}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_20, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); + PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_11}; + __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_21, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; + __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0; } - __pyx_t_20 = __Pyx_PyInt_From_int(__pyx_v_be_verbose); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 242, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_20); - __pyx_t_10 = NULL; + __pyx_t_21 = __Pyx_PyInt_From_int(__pyx_v_be_verbose); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 242, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_21); + __pyx_t_11 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_10)) { + __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_11)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_10); + __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; @@ -21824,11 +22342,11 @@ __pyx_t_10 = __pyx_memoryview_fromslice(__pyx_t_22, 1, (PyObject *(*)(char *)) _ } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_10, __pyx_t_1, __pyx_t_20}; + PyObject *__pyx_callargs[3] = {__pyx_t_11, __pyx_t_1, __pyx_t_21}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); - __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; + __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -21844,8 +22362,8 @@ __pyx_t_10 = __pyx_memoryview_fromslice(__pyx_t_22, 1, (PyObject *(*)(char *)) _ */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_vprint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 244, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_20 = __Pyx_PyInt_From_int(__pyx_v_be_verbose); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 244, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_20); + __pyx_t_21 = __Pyx_PyInt_From_int(__pyx_v_be_verbose); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 244, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_21); __pyx_t_1 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS @@ -21861,10 +22379,10 @@ __pyx_t_10 = __pyx_memoryview_fromslice(__pyx_t_22, 1, (PyObject *(*)(char *)) _ } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_1, __pyx_kp_s_Initializing_the_deconvolution, __pyx_t_20}; + PyObject *__pyx_callargs[3] = {__pyx_t_1, __pyx_kp_s_Initializing_the_deconvolution, __pyx_t_21}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; + __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 244, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -21880,14 +22398,14 @@ __pyx_t_10 = __pyx_memoryview_fromslice(__pyx_t_22, 1, (PyObject *(*)(char *)) _ */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_convolvedFFT, __pyx_n_s_ravel); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_20 = NULL; + __pyx_t_21 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_20 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_20)) { + __pyx_t_21 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_21)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_20); + __Pyx_INCREF(__pyx_t_21); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; @@ -21895,86 +22413,86 @@ __pyx_t_10 = __pyx_memoryview_fromslice(__pyx_t_22, 1, (PyObject *(*)(char *)) _ } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_20, NULL}; + PyObject *__pyx_callargs[2] = {__pyx_t_21, NULL}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); - __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0; + __Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - __pyx_t_27 = __Pyx_PyObject_to_MemoryviewSlice_ds___pyx_t_double_complex(__pyx_t_3, PyBUF_WRITABLE); if (unlikely(!__pyx_t_27.memview)) __PYX_ERR(0, 247, __pyx_L1_error) + __pyx_t_28 = __Pyx_PyObject_to_MemoryviewSlice_ds___pyx_t_double_complex(__pyx_t_3, PyBUF_WRITABLE); if (unlikely(!__pyx_t_28.memview)) __PYX_ERR(0, 247, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_v_convolvedFFTRaveled = __pyx_t_27; - __pyx_t_27.memview = NULL; - __pyx_t_27.data = NULL; + __pyx_v_convolvedFFTRaveled = __pyx_t_28; + __pyx_t_28.memview = NULL; + __pyx_t_28.data = NULL; /* "fastkde/nufft.pyx":250 * * #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.int64_t [:] dimInds = np.zeros([numDimensions],dtype=np.int_) */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 250, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 250, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyInt_From_npy_long(__pyx_v_freqSpaceSize); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 250, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_npy_int64(__pyx_v_freqSpaceSize); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 250, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_20 = PyList_New(1); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 250, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_20); + __pyx_t_21 = PyList_New(1); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 250, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_21); __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyList_SET_ITEM(__pyx_t_20, 0, __pyx_t_3)) __PYX_ERR(0, 250, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_21, 0, __pyx_t_3)) __PYX_ERR(0, 250, __pyx_L1_error); __pyx_t_3 = 0; __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 250, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_GIVEREF(__pyx_t_20); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_20)) __PYX_ERR(0, 250, __pyx_L1_error); - __pyx_t_20 = 0; - __pyx_t_20 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 250, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_20); + __Pyx_GIVEREF(__pyx_t_21); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_21)) __PYX_ERR(0, 250, __pyx_L1_error); + __pyx_t_21 = 0; + __pyx_t_21 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 250, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_21); __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 250, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_complex128); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 250, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_complex128); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 250, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (PyDict_SetItem(__pyx_t_20, __pyx_n_s_dtype, __pyx_t_10) < 0) __PYX_ERR(0, 250, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_20); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 250, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); + if (PyDict_SetItem(__pyx_t_21, __pyx_n_s_dtype, __pyx_t_11) < 0) __PYX_ERR(0, 250, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_21); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 250, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; - __pyx_t_27 = __Pyx_PyObject_to_MemoryviewSlice_ds___pyx_t_double_complex(__pyx_t_10, PyBUF_WRITABLE); if (unlikely(!__pyx_t_27.memview)) __PYX_ERR(0, 250, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_v_DFT = __pyx_t_27; - __pyx_t_27.memview = NULL; - __pyx_t_27.data = NULL; + __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0; + __pyx_t_28 = __Pyx_PyObject_to_MemoryviewSlice_ds___pyx_t_double_complex(__pyx_t_11, PyBUF_WRITABLE); if (unlikely(!__pyx_t_28.memview)) __PYX_ERR(0, 250, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_v_DFT = __pyx_t_28; + __pyx_t_28.memview = NULL; + __pyx_t_28.data = NULL; /* "fastkde/nufft.pyx":252 * 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.int64_t [:] dimInds = np.zeros([numDimensions],dtype=np.int_) # <<<<<<<<<<<<<< * * #Deconvolve the FFT (divide by the FFT of the gaussian) to obtain the DFT estimate */ - __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 252, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_20 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_zeros); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 252, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_20); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = __Pyx_PyInt_From_int(__pyx_v_numDimensions); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 252, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); + __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_np); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 252, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_21 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_zeros); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 252, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_21); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_11 = __Pyx_PyInt_From_int(__pyx_v_numDimensions); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 252, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 252, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_GIVEREF(__pyx_t_10); - if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_10)) __PYX_ERR(0, 252, __pyx_L1_error); - __pyx_t_10 = 0; - __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 252, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); + __Pyx_GIVEREF(__pyx_t_11); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_11)) __PYX_ERR(0, 252, __pyx_L1_error); + __pyx_t_11 = 0; + __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 252, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_3)) __PYX_ERR(0, 252, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_3)) __PYX_ERR(0, 252, __pyx_L1_error); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 252, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); @@ -21985,16 +22503,16 @@ __pyx_t_10 = __pyx_memoryview_fromslice(__pyx_t_22, 1, (PyObject *(*)(char *)) _ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_1) < 0) __PYX_ERR(0, 252, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_20, __pyx_t_10, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 252, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_21, __pyx_t_11, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 252, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int_t(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 252, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_12.memview)) __PYX_ERR(0, 252, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_v_dimInds = __pyx_t_11; - __pyx_t_11.memview = NULL; - __pyx_t_11.data = NULL; + __pyx_v_dimInds = __pyx_t_12; + __pyx_t_12.memview = NULL; + __pyx_t_12.data = NULL; /* "fastkde/nufft.pyx":255 * @@ -22005,16 +22523,16 @@ __pyx_t_10 = __pyx_memoryview_fromslice(__pyx_t_22, 1, (PyObject *(*)(char *)) _ */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_vprint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 255, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_10 = __Pyx_PyInt_From_int(__pyx_v_be_verbose); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 255, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_20 = NULL; + __pyx_t_11 = __Pyx_PyInt_From_int(__pyx_v_be_verbose); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 255, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_21 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_20 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_20)) { + __pyx_t_21 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_21)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_20); + __Pyx_INCREF(__pyx_t_21); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; @@ -22022,10 +22540,10 @@ __pyx_t_10 = __pyx_memoryview_fromslice(__pyx_t_22, 1, (PyObject *(*)(char *)) _ } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_20, __pyx_kp_s_Deconvolving_the_Fourier_transfo, __pyx_t_10}; + PyObject *__pyx_callargs[3] = {__pyx_t_21, __pyx_kp_s_Deconvolving_the_Fourier_transfo, __pyx_t_11}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); - __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0; - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 255, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -22055,10 +22573,10 @@ __pyx_t_10 = __pyx_memoryview_fromslice(__pyx_t_22, 1, (PyObject *(*)(char *)) _ * unravelIndex(i,frequencySizes,dimInds,numDimensions) * gaussArg = 0.0 */ - __pyx_t_19 = __pyx_v_freqSpaceSize; - __pyx_t_23 = __pyx_t_19; - for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_23; __pyx_t_5+=1) { - __pyx_v_i = __pyx_t_5; + __pyx_t_20 = __pyx_v_freqSpaceSize; + __pyx_t_24 = __pyx_t_20; + for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_24; __pyx_t_9+=1) { + __pyx_v_i = __pyx_t_9; /* "fastkde/nufft.pyx":258 * with nogil: @@ -22067,7 +22585,7 @@ __pyx_t_10 = __pyx_memoryview_fromslice(__pyx_t_22, 1, (PyObject *(*)(char *)) _ * gaussArg = 0.0 * for v in range(numDimensions): */ - __pyx_t_12 = __pyx_f_7fastkde_5nufft_unravelIndex(__pyx_v_i, __pyx_v_frequencySizes, __pyx_v_dimInds, __pyx_v_numDimensions); if (unlikely(__pyx_t_12 == ((int)-1) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 258, __pyx_L59_error) + __pyx_t_13 = __pyx_f_7fastkde_5nufft_unravelIndex(__pyx_v_i, __pyx_v_frequencySizes, __pyx_v_dimInds, __pyx_v_numDimensions); if (unlikely(__pyx_t_13 == ((int)-1) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 258, __pyx_L59_error) /* "fastkde/nufft.pyx":259 * for i in range(freqSpaceSize): @@ -22085,10 +22603,10 @@ __pyx_t_10 = __pyx_memoryview_fromslice(__pyx_t_22, 1, (PyObject *(*)(char *)) _ * gaussArg = gaussArg + (frequency_grids[v,dimInds[v]]*deltaxs[v])**2 * DFT[i] = convolvedFFTRaveled[i] * cexp(tau*gaussArg) */ - __pyx_t_12 = __pyx_v_numDimensions; - __pyx_t_13 = __pyx_t_12; - for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) { - __pyx_v_v = __pyx_t_14; + __pyx_t_13 = __pyx_v_numDimensions; + __pyx_t_14 = __pyx_t_13; + for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_14; __pyx_t_15+=1) { + __pyx_v_v = __pyx_t_15; /* "fastkde/nufft.pyx":261 * gaussArg = 0.0 @@ -22097,15 +22615,15 @@ __pyx_t_10 = __pyx_memoryview_fromslice(__pyx_t_22, 1, (PyObject *(*)(char *)) _ * DFT[i] = convolvedFFTRaveled[i] * cexp(tau*gaussArg) * */ - __pyx_t_17 = __pyx_v_v; - if (__pyx_t_17 < 0) __pyx_t_17 += __pyx_v_dimInds.shape[0]; - __pyx_t_25 = __pyx_v_v; - __pyx_t_26 = (*((__pyx_t_5numpy_int_t *) ( /* dim=0 */ (__pyx_v_dimInds.data + __pyx_t_17 * __pyx_v_dimInds.strides[0]) ))); - if (__pyx_t_25 < 0) __pyx_t_25 += __pyx_v_frequency_grids.shape[0]; - if (__pyx_t_26 < 0) __pyx_t_26 += __pyx_v_frequency_grids.shape[1]; __pyx_t_18 = __pyx_v_v; - if (__pyx_t_18 < 0) __pyx_t_18 += __pyx_v_deltaxs.shape[0]; - __pyx_v_gaussArg = (__pyx_v_gaussArg + pow(((*((__pyx_t_5numpy_float_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_frequency_grids.data + __pyx_t_25 * __pyx_v_frequency_grids.strides[0]) ) + __pyx_t_26 * __pyx_v_frequency_grids.strides[1]) ))) * (*((__pyx_t_5numpy_float_t *) ( /* dim=0 */ (__pyx_v_deltaxs.data + __pyx_t_18 * __pyx_v_deltaxs.strides[0]) )))), 2.0)); + if (__pyx_t_18 < 0) __pyx_t_18 += __pyx_v_dimInds.shape[0]; + __pyx_t_26 = __pyx_v_v; + __pyx_t_39 = (*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_dimInds.data + __pyx_t_18 * __pyx_v_dimInds.strides[0]) ))); + if (__pyx_t_26 < 0) __pyx_t_26 += __pyx_v_frequency_grids.shape[0]; + if (__pyx_t_39 < 0) __pyx_t_39 += __pyx_v_frequency_grids.shape[1]; + __pyx_t_27 = __pyx_v_v; + if (__pyx_t_27 < 0) __pyx_t_27 += __pyx_v_deltaxs.shape[0]; + __pyx_v_gaussArg = (__pyx_v_gaussArg + pow(((*((__pyx_t_5numpy_float_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_frequency_grids.data + __pyx_t_26 * __pyx_v_frequency_grids.strides[0]) ) + __pyx_t_39 * __pyx_v_frequency_grids.strides[1]) ))) * (*((__pyx_t_5numpy_float_t *) ( /* dim=0 */ (__pyx_v_deltaxs.data + __pyx_t_27 * __pyx_v_deltaxs.strides[0]) )))), 2.0)); } /* "fastkde/nufft.pyx":262 @@ -22115,11 +22633,11 @@ __pyx_t_10 = __pyx_memoryview_fromslice(__pyx_t_22, 1, (PyObject *(*)(char *)) _ * * */ + __pyx_t_27 = __pyx_v_i; + if (__pyx_t_27 < 0) __pyx_t_27 += __pyx_v_convolvedFFTRaveled.shape[0]; __pyx_t_18 = __pyx_v_i; - if (__pyx_t_18 < 0) __pyx_t_18 += __pyx_v_convolvedFFTRaveled.shape[0]; - __pyx_t_17 = __pyx_v_i; - if (__pyx_t_17 < 0) __pyx_t_17 += __pyx_v_DFT.shape[0]; - *((__pyx_t_double_complex *) ( /* dim=0 */ (__pyx_v_DFT.data + __pyx_t_17 * __pyx_v_DFT.strides[0]) )) = __Pyx_c_prod_double((*((__pyx_t_double_complex *) ( /* dim=0 */ (__pyx_v_convolvedFFTRaveled.data + __pyx_t_18 * __pyx_v_convolvedFFTRaveled.strides[0]) ))), __pyx_f_7fastkde_5nufft_cexp(__pyx_t_double_complex_from_parts((__pyx_v_tau * __pyx_v_gaussArg), 0))); + if (__pyx_t_18 < 0) __pyx_t_18 += __pyx_v_DFT.shape[0]; + *((__pyx_t_double_complex *) ( /* dim=0 */ (__pyx_v_DFT.data + __pyx_t_18 * __pyx_v_DFT.strides[0]) )) = __Pyx_c_prod_double((*((__pyx_t_double_complex *) ( /* dim=0 */ (__pyx_v_convolvedFFTRaveled.data + __pyx_t_27 * __pyx_v_convolvedFFTRaveled.strides[0]) ))), __pyx_f_7fastkde_5nufft_cexp(__pyx_t_double_complex_from_parts((__pyx_v_tau * __pyx_v_gaussArg), 0))); } } @@ -22158,16 +22676,16 @@ __pyx_t_10 = __pyx_memoryview_fromslice(__pyx_t_22, 1, (PyObject *(*)(char *)) _ */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_vprint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 266, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_10 = __Pyx_PyInt_From_int(__pyx_v_be_verbose); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 266, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_20 = NULL; + __pyx_t_11 = __Pyx_PyInt_From_int(__pyx_v_be_verbose); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 266, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_21 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_20 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_20)) { + __pyx_t_21 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_21)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_20); + __Pyx_INCREF(__pyx_t_21); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; @@ -22175,10 +22693,10 @@ __pyx_t_10 = __pyx_memoryview_fromslice(__pyx_t_22, 1, (PyObject *(*)(char *)) _ } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_20, __pyx_kp_s_Reshaping_and_returning, __pyx_t_10}; + PyObject *__pyx_callargs[3] = {__pyx_t_21, __pyx_kp_s_Reshaping_and_returning, __pyx_t_11}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); - __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0; - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 266, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -22195,39 +22713,39 @@ __pyx_t_10 = __pyx_memoryview_fromslice(__pyx_t_22, 1, (PyObject *(*)(char *)) _ __Pyx_XDECREF((PyObject *)__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 267, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_reshape); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 267, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_reshape); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 267, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_DFT, 1, (PyObject *(*)(char *)) __pyx_memview_get___pyx_t_double_complex, (int (*)(char *, PyObject *)) __pyx_memview_set___pyx_t_double_complex, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 267, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_20 = __pyx_memoryview_fromslice(__pyx_v_frequencySizes, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int_t, 0);; if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 267, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_20); - __pyx_t_2 = __Pyx_PySequence_Tuple(__pyx_t_20); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 267, __pyx_L1_error) + __pyx_t_21 = __pyx_memoryview_fromslice(__pyx_v_frequencySizes, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int64_t, 0);; if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 267, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_21); + __pyx_t_2 = __Pyx_PySequence_Tuple(__pyx_t_21); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 267, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; - __pyx_t_20 = NULL; + __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0; + __pyx_t_21 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_10))) { - __pyx_t_20 = PyMethod_GET_SELF(__pyx_t_10); - if (likely(__pyx_t_20)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); - __Pyx_INCREF(__pyx_t_20); + if (unlikely(PyMethod_Check(__pyx_t_11))) { + __pyx_t_21 = PyMethod_GET_SELF(__pyx_t_11); + if (likely(__pyx_t_21)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11); + __Pyx_INCREF(__pyx_t_21); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_10, function); + __Pyx_DECREF_SET(__pyx_t_11, function); __pyx_t_5 = 1; } } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_20, __pyx_t_3, __pyx_t_2}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); - __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0; + PyObject *__pyx_callargs[3] = {__pyx_t_21, __pyx_t_3, __pyx_t_2}; + __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_11, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); + __Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 267, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 267, __pyx_L1_error) __pyx_r = ((PyArrayObject *)__pyx_t_1); @@ -22248,17 +22766,17 @@ __pyx_t_10 = __pyx_memoryview_fromslice(__pyx_t_22, 1, (PyObject *(*)(char *)) _ __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_10); - __PYX_XCLEAR_MEMVIEW(&__pyx_t_11, 1); - __Pyx_XDECREF(__pyx_t_20); - __PYX_XCLEAR_MEMVIEW(&__pyx_t_21, 1); + __Pyx_XDECREF(__pyx_t_11); + __PYX_XCLEAR_MEMVIEW(&__pyx_t_12, 1); + __Pyx_XDECREF(__pyx_t_21); __PYX_XCLEAR_MEMVIEW(&__pyx_t_22, 1); - __PYX_XCLEAR_MEMVIEW(&__pyx_t_27, 1); - __Pyx_XDECREF(__pyx_t_33); + __PYX_XCLEAR_MEMVIEW(&__pyx_t_23, 1); + __PYX_XCLEAR_MEMVIEW(&__pyx_t_28, 1); __Pyx_XDECREF(__pyx_t_34); __Pyx_XDECREF(__pyx_t_35); __Pyx_XDECREF(__pyx_t_36); __Pyx_XDECREF(__pyx_t_37); + __Pyx_XDECREF(__pyx_t_38); __Pyx_AddTraceback("fastkde.nufft.nuifft", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; @@ -22538,7 +23056,7 @@ static PyArrayObject *__pyx_f_7fastkde_5nufft_idft(__Pyx_memviewslice __pyx_v_ab int __pyx_v_t; int __pyx_v_iNotMissing; __Pyx_memviewslice __pyx_v_frequencySizes = { 0, 0, { 0 }, { 0 }, { 0 } }; - __pyx_t_5numpy_int_t __pyx_v_freqSpaceSize; + __pyx_t_5numpy_int64_t __pyx_v_freqSpaceSize; __Pyx_memviewslice __pyx_v_DFT = { 0, 0, { 0 }, { 0 }, { 0 } }; int __pyx_v_i; int __pyx_v_k; @@ -22552,28 +23070,29 @@ static PyArrayObject *__pyx_f_7fastkde_5nufft_idft(__Pyx_memviewslice __pyx_v_ab PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; + unsigned int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; int __pyx_t_9; - PyObject *__pyx_t_10 = NULL; - __Pyx_memviewslice __pyx_t_11 = { 0, 0, { 0 }, { 0 }, { 0 } }; - int __pyx_t_12; + int __pyx_t_10; + PyObject *__pyx_t_11 = NULL; + __Pyx_memviewslice __pyx_t_12 = { 0, 0, { 0 }, { 0 }, { 0 } }; int __pyx_t_13; int __pyx_t_14; int __pyx_t_15; int __pyx_t_16; - Py_ssize_t __pyx_t_17; + int __pyx_t_17; Py_ssize_t __pyx_t_18; - __pyx_t_5numpy_int_t __pyx_t_19; - __Pyx_memviewslice __pyx_t_20 = { 0, 0, { 0 }, { 0 }, { 0 } }; - __pyx_t_5numpy_int_t __pyx_t_21; - int __pyx_t_22; - Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_19; + __pyx_t_5numpy_int64_t __pyx_t_20; + __Pyx_memviewslice __pyx_t_21 = { 0, 0, { 0 }, { 0 }, { 0 } }; + __pyx_t_5numpy_int64_t __pyx_t_22; + int __pyx_t_23; Py_ssize_t __pyx_t_24; Py_ssize_t __pyx_t_25; + __pyx_t_5numpy_int64_t __pyx_t_26; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; @@ -22676,9 +23195,9 @@ static PyArrayObject *__pyx_f_7fastkde_5nufft_idft(__Pyx_memviewslice __pyx_v_ab __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 327, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 327, __pyx_L3_error) + __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 327, __pyx_L3_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_v_numDimensions = __pyx_t_4; + __pyx_v_numDimensions = __pyx_t_9; /* "fastkde/nufft.pyx":328 * try: @@ -22720,9 +23239,9 @@ static PyArrayObject *__pyx_f_7fastkde_5nufft_idft(__Pyx_memviewslice __pyx_v_ab __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_3, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 328, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 328, __pyx_L3_error) + __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 328, __pyx_L3_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_v_numDataPoints = __pyx_t_4; + __pyx_v_numDataPoints = __pyx_t_9; /* "fastkde/nufft.pyx":326 * #Get the shape of abscissas @@ -22918,9 +23437,9 @@ static PyArrayObject *__pyx_f_7fastkde_5nufft_idft(__Pyx_memviewslice __pyx_v_ab __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = PyObject_RichCompare(__pyx_v_ordShape, __pyx_t_3, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 338, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 338, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 338, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(__pyx_t_9)) { + if (unlikely(__pyx_t_10)) { /* "fastkde/nufft.pyx":339 * @@ -23076,9 +23595,9 @@ static PyArrayObject *__pyx_f_7fastkde_5nufft_idft(__Pyx_memviewslice __pyx_v_ab __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 347, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 347, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 347, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(__pyx_t_9)) { + if (unlikely(__pyx_t_10)) { /* "fastkde/nufft.pyx":348 * @@ -23111,16 +23630,16 @@ static PyArrayObject *__pyx_f_7fastkde_5nufft_idft(__Pyx_memviewslice __pyx_v_ab */ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_freqShape, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 351, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 351, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 351, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_v_ntMax = __pyx_t_4; + __pyx_v_ntMax = __pyx_t_9; /* "fastkde/nufft.pyx":357 * # Calculate the size of the frequency spaces * #******************************************** * vprint("Getting the size of the frequency spaces",be_verbose) # <<<<<<<<<<<<<< * cdef int n,t,iNotMissing - * cdef np.int_t [:] frequencySizes = np.zeros([numDimensions],dtype=np.int_) + * cdef np.int64_t [:] frequencySizes = np.zeros([numDimensions],dtype=np.int_) */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_vprint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 357, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); @@ -23151,7 +23670,7 @@ static PyArrayObject *__pyx_f_7fastkde_5nufft_idft(__Pyx_memviewslice __pyx_v_ab /* "fastkde/nufft.pyx":359 * vprint("Getting the size of the frequency spaces",be_verbose) * cdef int n,t,iNotMissing - * cdef np.int_t [:] frequencySizes = np.zeros([numDimensions],dtype=np.int_) # <<<<<<<<<<<<<< + * cdef np.int64_t [:] frequencySizes = np.zeros([numDimensions],dtype=np.int_) # <<<<<<<<<<<<<< * * for n in range(numDimensions): */ @@ -23176,33 +23695,33 @@ static PyArrayObject *__pyx_f_7fastkde_5nufft_idft(__Pyx_memviewslice __pyx_v_ab __Pyx_GOTREF(__pyx_t_3); __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 359, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_int); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 359, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_int); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 359, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_10) < 0) __PYX_ERR(0, 359, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 359, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_11) < 0) __PYX_ERR(0, 359, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 359, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int_t(__pyx_t_10, PyBUF_WRITABLE); if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 359, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_v_frequencySizes = __pyx_t_11; - __pyx_t_11.memview = NULL; - __pyx_t_11.data = NULL; + __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(__pyx_t_11, PyBUF_WRITABLE); if (unlikely(!__pyx_t_12.memview)) __PYX_ERR(0, 359, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_v_frequencySizes = __pyx_t_12; + __pyx_t_12.memview = NULL; + __pyx_t_12.data = NULL; /* "fastkde/nufft.pyx":361 - * cdef np.int_t [:] frequencySizes = np.zeros([numDimensions],dtype=np.int_) + * cdef np.int64_t [:] frequencySizes = np.zeros([numDimensions],dtype=np.int_) * * for n in range(numDimensions): # <<<<<<<<<<<<<< * iNotMissing = 0 * for t in range(ntMax): */ - __pyx_t_4 = __pyx_v_numDimensions; - __pyx_t_12 = __pyx_t_4; - for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) { - __pyx_v_n = __pyx_t_13; + __pyx_t_9 = __pyx_v_numDimensions; + __pyx_t_13 = __pyx_t_9; + for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) { + __pyx_v_n = __pyx_t_14; /* "fastkde/nufft.pyx":362 * @@ -23220,10 +23739,10 @@ static PyArrayObject *__pyx_f_7fastkde_5nufft_idft(__Pyx_memviewslice __pyx_v_ab * if frequency_grids[n,t] != missing_freq_val: * iNotMissing += 1 */ - __pyx_t_14 = __pyx_v_ntMax; - __pyx_t_15 = __pyx_t_14; - for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) { - __pyx_v_t = __pyx_t_16; + __pyx_t_15 = __pyx_v_ntMax; + __pyx_t_16 = __pyx_t_15; + for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) { + __pyx_v_t = __pyx_t_17; /* "fastkde/nufft.pyx":364 * iNotMissing = 0 @@ -23232,19 +23751,19 @@ static PyArrayObject *__pyx_f_7fastkde_5nufft_idft(__Pyx_memviewslice __pyx_v_ab * iNotMissing += 1 * if iNotMissing != 0: */ - __pyx_t_17 = __pyx_v_n; - __pyx_t_18 = __pyx_v_t; - if (__pyx_t_17 < 0) __pyx_t_17 += __pyx_v_frequency_grids.shape[0]; - if (__pyx_t_18 < 0) __pyx_t_18 += __pyx_v_frequency_grids.shape[1]; - __pyx_t_9 = ((*((__pyx_t_5numpy_float_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_frequency_grids.data + __pyx_t_17 * __pyx_v_frequency_grids.strides[0]) ) + __pyx_t_18 * __pyx_v_frequency_grids.strides[1]) ))) != __pyx_v_missing_freq_val); - if (__pyx_t_9) { + __pyx_t_18 = __pyx_v_n; + __pyx_t_19 = __pyx_v_t; + if (__pyx_t_18 < 0) __pyx_t_18 += __pyx_v_frequency_grids.shape[0]; + if (__pyx_t_19 < 0) __pyx_t_19 += __pyx_v_frequency_grids.shape[1]; + __pyx_t_10 = ((*((__pyx_t_5numpy_float_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_frequency_grids.data + __pyx_t_18 * __pyx_v_frequency_grids.strides[0]) ) + __pyx_t_19 * __pyx_v_frequency_grids.strides[1]) ))) != __pyx_v_missing_freq_val); + if (__pyx_t_10) { /* "fastkde/nufft.pyx":365 * for t in range(ntMax): * if frequency_grids[n,t] != missing_freq_val: * iNotMissing += 1 # <<<<<<<<<<<<<< * if iNotMissing != 0: - * frequencySizes[n] = iNotMissing + * frequencySizes[n] = iNotMissing */ __pyx_v_iNotMissing = (__pyx_v_iNotMissing + 1); @@ -23262,45 +23781,45 @@ static PyArrayObject *__pyx_f_7fastkde_5nufft_idft(__Pyx_memviewslice __pyx_v_ab * if frequency_grids[n,t] != missing_freq_val: * iNotMissing += 1 * if iNotMissing != 0: # <<<<<<<<<<<<<< - * frequencySizes[n] = iNotMissing + * frequencySizes[n] = iNotMissing * else: */ - __pyx_t_9 = (__pyx_v_iNotMissing != 0); - if (likely(__pyx_t_9)) { + __pyx_t_10 = (__pyx_v_iNotMissing != 0); + if (likely(__pyx_t_10)) { /* "fastkde/nufft.pyx":367 * iNotMissing += 1 * if iNotMissing != 0: - * frequencySizes[n] = iNotMissing # <<<<<<<<<<<<<< + * frequencySizes[n] = iNotMissing # <<<<<<<<<<<<<< * else: * raise ValueError("Some frequencies in frequency_grids have no valid points") */ - __pyx_t_18 = __pyx_v_n; - if (__pyx_t_18 < 0) __pyx_t_18 += __pyx_v_frequencySizes.shape[0]; - *((__pyx_t_5numpy_int_t *) ( /* dim=0 */ (__pyx_v_frequencySizes.data + __pyx_t_18 * __pyx_v_frequencySizes.strides[0]) )) = ((__pyx_t_5numpy_int_t)__pyx_v_iNotMissing); + __pyx_t_19 = __pyx_v_n; + if (__pyx_t_19 < 0) __pyx_t_19 += __pyx_v_frequencySizes.shape[0]; + *((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_frequencySizes.data + __pyx_t_19 * __pyx_v_frequencySizes.strides[0]) )) = ((__pyx_t_5numpy_int64_t)__pyx_v_iNotMissing); /* "fastkde/nufft.pyx":366 * if frequency_grids[n,t] != missing_freq_val: * iNotMissing += 1 * if iNotMissing != 0: # <<<<<<<<<<<<<< - * frequencySizes[n] = iNotMissing + * frequencySizes[n] = iNotMissing * else: */ goto __pyx_L34; } /* "fastkde/nufft.pyx":369 - * frequencySizes[n] = iNotMissing + * frequencySizes[n] = iNotMissing * else: * raise ValueError("Some frequencies in frequency_grids have no valid points") # <<<<<<<<<<<<<< * * #Get the total size of the frequency space */ /*else*/ { - __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 369, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __Pyx_Raise(__pyx_t_10, 0, 0, 0); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_11 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 369, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_Raise(__pyx_t_11, 0, 0, 0); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __PYX_ERR(0, 369, __pyx_L1_error) } __pyx_L34:; @@ -23309,7 +23828,7 @@ static PyArrayObject *__pyx_f_7fastkde_5nufft_idft(__Pyx_memviewslice __pyx_v_ab /* "fastkde/nufft.pyx":372 * * #Get the total size of the frequency space - * cdef np.int_t freqSpaceSize = np.prod(frequencySizes) # <<<<<<<<<<<<<< + * cdef np.int64_t freqSpaceSize = np.prod(frequencySizes) # <<<<<<<<<<<<<< * * #Pre-declare and allocate a raveled form of the DFT */ @@ -23318,7 +23837,7 @@ static PyArrayObject *__pyx_f_7fastkde_5nufft_idft(__Pyx_memviewslice __pyx_v_ab __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_prod); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 372, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_frequencySizes, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int_t, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 372, __pyx_L1_error) + __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_frequencySizes, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int64_t, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 372, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = NULL; __pyx_t_4 = 0; @@ -23336,16 +23855,16 @@ static PyArrayObject *__pyx_f_7fastkde_5nufft_idft(__Pyx_memviewslice __pyx_v_ab #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_3}; - __pyx_t_10 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); + __pyx_t_11 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 372, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); + if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 372, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - __pyx_t_19 = __Pyx_PyInt_As_npy_long(__pyx_t_10); if (unlikely((__pyx_t_19 == ((npy_long)-1)) && PyErr_Occurred())) __PYX_ERR(0, 372, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_v_freqSpaceSize = __pyx_t_19; + __pyx_t_20 = __Pyx_PyInt_As_npy_int64(__pyx_t_11); if (unlikely((__pyx_t_20 == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 372, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_v_freqSpaceSize = __pyx_t_20; /* "fastkde/nufft.pyx":375 * @@ -23354,22 +23873,22 @@ static PyArrayObject *__pyx_f_7fastkde_5nufft_idft(__Pyx_memviewslice __pyx_v_ab * * cdef int i,k */ - __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 375, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 375, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_np); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 375, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 375, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = __Pyx_PyInt_From_npy_long(__pyx_v_freqSpaceSize); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 375, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_11 = __Pyx_PyInt_From_npy_int64(__pyx_v_freqSpaceSize); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 375, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 375, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_GIVEREF(__pyx_t_10); - if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_10)) __PYX_ERR(0, 375, __pyx_L1_error); - __pyx_t_10 = 0; - __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 375, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); + __Pyx_GIVEREF(__pyx_t_11); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_11)) __PYX_ERR(0, 375, __pyx_L1_error); + __pyx_t_11 = 0; + __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 375, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_3)) __PYX_ERR(0, 375, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_3)) __PYX_ERR(0, 375, __pyx_L1_error); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 375, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); @@ -23380,21 +23899,21 @@ static PyArrayObject *__pyx_f_7fastkde_5nufft_idft(__Pyx_memviewslice __pyx_v_ab __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_8) < 0) __PYX_ERR(0, 375, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_10, __pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 375, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_11, __pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 375, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_20 = __Pyx_PyObject_to_MemoryviewSlice_ds___pyx_t_double_complex(__pyx_t_8, PyBUF_WRITABLE); if (unlikely(!__pyx_t_20.memview)) __PYX_ERR(0, 375, __pyx_L1_error) + __pyx_t_21 = __Pyx_PyObject_to_MemoryviewSlice_ds___pyx_t_double_complex(__pyx_t_8, PyBUF_WRITABLE); if (unlikely(!__pyx_t_21.memview)) __PYX_ERR(0, 375, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_v_DFT = __pyx_t_20; - __pyx_t_20.memview = NULL; - __pyx_t_20.data = NULL; + __pyx_v_DFT = __pyx_t_21; + __pyx_t_21.memview = NULL; + __pyx_t_21.data = NULL; /* "fastkde/nufft.pyx":380 * * #Pre declare a dimension index vector - * cdef np.int_t [:] dimInds = np.zeros([numDimensions],dtype=np.int_) # <<<<<<<<<<<<<< + * cdef np.int64_t [:] dimInds = np.zeros([numDimensions],dtype=np.int_) # <<<<<<<<<<<<<< * * cdef double complex myDFT */ @@ -23405,35 +23924,35 @@ static PyArrayObject *__pyx_f_7fastkde_5nufft_idft(__Pyx_memviewslice __pyx_v_ab __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_numDimensions); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 380, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_10 = PyList_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 380, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); + __pyx_t_11 = PyList_New(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 380, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); __Pyx_GIVEREF(__pyx_t_8); - if (__Pyx_PyList_SET_ITEM(__pyx_t_10, 0, __pyx_t_8)) __PYX_ERR(0, 380, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_11, 0, __pyx_t_8)) __PYX_ERR(0, 380, __pyx_L1_error); __pyx_t_8 = 0; __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 380, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __Pyx_GIVEREF(__pyx_t_10); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_10)) __PYX_ERR(0, 380, __pyx_L1_error); - __pyx_t_10 = 0; - __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 380, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); + __Pyx_GIVEREF(__pyx_t_11); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_11)) __PYX_ERR(0, 380, __pyx_L1_error); + __pyx_t_11 = 0; + __pyx_t_11 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 380, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 380, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_int); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 380, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_dtype, __pyx_t_2) < 0) __PYX_ERR(0, 380, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_dtype, __pyx_t_2) < 0) __PYX_ERR(0, 380, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_8, __pyx_t_10); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 380, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_8, __pyx_t_11); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 380, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int_t(__pyx_t_2, PyBUF_WRITABLE); if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 380, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(__pyx_t_2, PyBUF_WRITABLE); if (unlikely(!__pyx_t_12.memview)) __PYX_ERR(0, 380, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_v_dimInds = __pyx_t_11; - __pyx_t_11.memview = NULL; - __pyx_t_11.data = NULL; + __pyx_v_dimInds = __pyx_t_12; + __pyx_t_12.memview = NULL; + __pyx_t_12.data = NULL; /* "fastkde/nufft.pyx":385 * cdef double expArg @@ -23451,29 +23970,29 @@ static PyArrayObject *__pyx_f_7fastkde_5nufft_idft(__Pyx_memviewslice __pyx_v_ab * with nogil: * for i in range(freqSpaceSize): */ - __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_vprint); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 388, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); + __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_vprint); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 388, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); __pyx_t_8 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_10))) { - __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_10); + if (unlikely(PyMethod_Check(__pyx_t_11))) { + __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_11); if (likely(__pyx_t_8)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_10, function); + __Pyx_DECREF_SET(__pyx_t_11, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_8, __pyx_kp_s_Calculting_the_DFT, __pyx_v_be_verbose}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); + __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_11, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 388, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -23500,10 +24019,10 @@ static PyArrayObject *__pyx_f_7fastkde_5nufft_idft(__Pyx_memviewslice __pyx_v_ab * unravelIndex(i,frequencySizes,dimInds,numDimensions) * */ - __pyx_t_19 = __pyx_v_freqSpaceSize; - __pyx_t_21 = __pyx_t_19; - for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_21; __pyx_t_4+=1) { - __pyx_v_i = __pyx_t_4; + __pyx_t_20 = __pyx_v_freqSpaceSize; + __pyx_t_22 = __pyx_t_20; + for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_22; __pyx_t_9+=1) { + __pyx_v_i = __pyx_t_9; /* "fastkde/nufft.pyx":391 * with nogil: @@ -23512,7 +24031,7 @@ static PyArrayObject *__pyx_f_7fastkde_5nufft_idft(__Pyx_memviewslice __pyx_v_ab * * myDFT = 0.0 + 0.0j */ - __pyx_t_12 = __pyx_f_7fastkde_5nufft_unravelIndex(__pyx_v_i, __pyx_v_frequencySizes, __pyx_v_dimInds, __pyx_v_numDimensions); if (unlikely(__pyx_t_12 == ((int)-1) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 391, __pyx_L36_error) + __pyx_t_13 = __pyx_f_7fastkde_5nufft_unravelIndex(__pyx_v_i, __pyx_v_frequencySizes, __pyx_v_dimInds, __pyx_v_numDimensions); if (unlikely(__pyx_t_13 == ((int)-1) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 391, __pyx_L36_error) /* "fastkde/nufft.pyx":393 * unravelIndex(i,frequencySizes,dimInds,numDimensions) @@ -23530,10 +24049,10 @@ static PyArrayObject *__pyx_f_7fastkde_5nufft_idft(__Pyx_memviewslice __pyx_v_ab * expArg = 0.0 * */ - __pyx_t_12 = __pyx_v_numDataPoints; - __pyx_t_13 = __pyx_t_12; - for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) { - __pyx_v_j = __pyx_t_14; + __pyx_t_13 = __pyx_v_numDataPoints; + __pyx_t_14 = __pyx_t_13; + for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_14; __pyx_t_15+=1) { + __pyx_v_j = __pyx_t_15; /* "fastkde/nufft.pyx":396 * @@ -23551,10 +24070,10 @@ static PyArrayObject *__pyx_f_7fastkde_5nufft_idft(__Pyx_memviewslice __pyx_v_ab * expArg = expArg +(abscissas[k,j] * frequency_grids[k,dimInds[k]]) * */ - __pyx_t_15 = __pyx_v_numDimensions; - __pyx_t_16 = __pyx_t_15; - for (__pyx_t_22 = 0; __pyx_t_22 < __pyx_t_16; __pyx_t_22+=1) { - __pyx_v_k = __pyx_t_22; + __pyx_t_16 = __pyx_v_numDimensions; + __pyx_t_17 = __pyx_t_16; + for (__pyx_t_23 = 0; __pyx_t_23 < __pyx_t_17; __pyx_t_23+=1) { + __pyx_v_k = __pyx_t_23; /* "fastkde/nufft.pyx":399 * @@ -23563,17 +24082,17 @@ static PyArrayObject *__pyx_f_7fastkde_5nufft_idft(__Pyx_memviewslice __pyx_v_ab * * myDFT = myDFT + ordinates[j]*cexp(dftConst * expArg) */ - __pyx_t_18 = __pyx_v_k; - __pyx_t_17 = __pyx_v_j; - if (__pyx_t_18 < 0) __pyx_t_18 += __pyx_v_abscissas.shape[0]; - if (__pyx_t_17 < 0) __pyx_t_17 += __pyx_v_abscissas.shape[1]; - __pyx_t_23 = __pyx_v_k; - if (__pyx_t_23 < 0) __pyx_t_23 += __pyx_v_dimInds.shape[0]; + __pyx_t_19 = __pyx_v_k; + __pyx_t_18 = __pyx_v_j; + if (__pyx_t_19 < 0) __pyx_t_19 += __pyx_v_abscissas.shape[0]; + if (__pyx_t_18 < 0) __pyx_t_18 += __pyx_v_abscissas.shape[1]; __pyx_t_24 = __pyx_v_k; - __pyx_t_25 = (*((__pyx_t_5numpy_int_t *) ( /* dim=0 */ (__pyx_v_dimInds.data + __pyx_t_23 * __pyx_v_dimInds.strides[0]) ))); - if (__pyx_t_24 < 0) __pyx_t_24 += __pyx_v_frequency_grids.shape[0]; - if (__pyx_t_25 < 0) __pyx_t_25 += __pyx_v_frequency_grids.shape[1]; - __pyx_v_expArg = (__pyx_v_expArg + ((*((__pyx_t_5numpy_float_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_abscissas.data + __pyx_t_18 * __pyx_v_abscissas.strides[0]) ) + __pyx_t_17 * __pyx_v_abscissas.strides[1]) ))) * (*((__pyx_t_5numpy_float_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_frequency_grids.data + __pyx_t_24 * __pyx_v_frequency_grids.strides[0]) ) + __pyx_t_25 * __pyx_v_frequency_grids.strides[1]) ))))); + if (__pyx_t_24 < 0) __pyx_t_24 += __pyx_v_dimInds.shape[0]; + __pyx_t_25 = __pyx_v_k; + __pyx_t_26 = (*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_dimInds.data + __pyx_t_24 * __pyx_v_dimInds.strides[0]) ))); + if (__pyx_t_25 < 0) __pyx_t_25 += __pyx_v_frequency_grids.shape[0]; + if (__pyx_t_26 < 0) __pyx_t_26 += __pyx_v_frequency_grids.shape[1]; + __pyx_v_expArg = (__pyx_v_expArg + ((*((__pyx_t_5numpy_float_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_abscissas.data + __pyx_t_19 * __pyx_v_abscissas.strides[0]) ) + __pyx_t_18 * __pyx_v_abscissas.strides[1]) ))) * (*((__pyx_t_5numpy_float_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_frequency_grids.data + __pyx_t_25 * __pyx_v_frequency_grids.strides[0]) ) + __pyx_t_26 * __pyx_v_frequency_grids.strides[1]) ))))); } /* "fastkde/nufft.pyx":401 @@ -23583,9 +24102,9 @@ static PyArrayObject *__pyx_f_7fastkde_5nufft_idft(__Pyx_memviewslice __pyx_v_ab * * DFT[i] = myDFT */ - __pyx_t_23 = __pyx_v_j; - if (__pyx_t_23 < 0) __pyx_t_23 += __pyx_v_ordinates.shape[0]; - __pyx_v_myDFT = __Pyx_c_sum_double(__pyx_v_myDFT, __Pyx_c_prod_double((*((__pyx_t_double_complex *) ( /* dim=0 */ (__pyx_v_ordinates.data + __pyx_t_23 * __pyx_v_ordinates.strides[0]) ))), __pyx_f_7fastkde_5nufft_cexp(__Pyx_c_prod_double(__pyx_v_dftConst, __pyx_t_double_complex_from_parts(((double)__pyx_v_expArg), 0))))); + __pyx_t_24 = __pyx_v_j; + if (__pyx_t_24 < 0) __pyx_t_24 += __pyx_v_ordinates.shape[0]; + __pyx_v_myDFT = __Pyx_c_sum_double(__pyx_v_myDFT, __Pyx_c_prod_double((*((__pyx_t_double_complex *) ( /* dim=0 */ (__pyx_v_ordinates.data + __pyx_t_24 * __pyx_v_ordinates.strides[0]) ))), __pyx_f_7fastkde_5nufft_cexp(__Pyx_c_prod_double(__pyx_v_dftConst, __pyx_t_double_complex_from_parts(((double)__pyx_v_expArg), 0))))); } /* "fastkde/nufft.pyx":403 @@ -23595,9 +24114,9 @@ static PyArrayObject *__pyx_f_7fastkde_5nufft_idft(__Pyx_memviewslice __pyx_v_ab * * return np.reshape(DFT,tuple(frequencySizes)) */ - __pyx_t_23 = __pyx_v_i; - if (__pyx_t_23 < 0) __pyx_t_23 += __pyx_v_DFT.shape[0]; - *((__pyx_t_double_complex *) ( /* dim=0 */ (__pyx_v_DFT.data + __pyx_t_23 * __pyx_v_DFT.strides[0]) )) = __pyx_v_myDFT; + __pyx_t_24 = __pyx_v_i; + if (__pyx_t_24 < 0) __pyx_t_24 += __pyx_v_DFT.shape[0]; + *((__pyx_t_double_complex *) ( /* dim=0 */ (__pyx_v_DFT.data + __pyx_t_24 * __pyx_v_DFT.strides[0]) )) = __pyx_v_myDFT; } } @@ -23635,14 +24154,14 @@ static PyArrayObject *__pyx_f_7fastkde_5nufft_idft(__Pyx_memviewslice __pyx_v_ab * #******************************************************************************* */ __Pyx_XDECREF((PyObject *)__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 405, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_reshape); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 405, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_np); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 405, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_reshape); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 405, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = __pyx_memoryview_fromslice(__pyx_v_DFT, 1, (PyObject *(*)(char *)) __pyx_memview_get___pyx_t_double_complex, (int (*)(char *, PyObject *)) __pyx_memview_set___pyx_t_double_complex, 0);; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 405, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_frequencySizes, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int_t, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 405, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_11 = __pyx_memoryview_fromslice(__pyx_v_DFT, 1, (PyObject *(*)(char *)) __pyx_memview_get___pyx_t_double_complex, (int (*)(char *, PyObject *)) __pyx_memview_set___pyx_t_double_complex, 0);; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 405, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_frequencySizes, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int64_t, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 405, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __Pyx_PySequence_Tuple(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 405, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); @@ -23662,10 +24181,10 @@ static PyArrayObject *__pyx_f_7fastkde_5nufft_idft(__Pyx_memviewslice __pyx_v_ab } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_t_10, __pyx_t_1}; + PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_t_11, __pyx_t_1}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 405, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); @@ -23690,9 +24209,9 @@ static PyArrayObject *__pyx_f_7fastkde_5nufft_idft(__Pyx_memviewslice __pyx_v_ab __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_8); - __Pyx_XDECREF(__pyx_t_10); - __PYX_XCLEAR_MEMVIEW(&__pyx_t_11, 1); - __PYX_XCLEAR_MEMVIEW(&__pyx_t_20, 1); + __Pyx_XDECREF(__pyx_t_11); + __PYX_XCLEAR_MEMVIEW(&__pyx_t_12, 1); + __PYX_XCLEAR_MEMVIEW(&__pyx_t_21, 1); __Pyx_AddTraceback("fastkde.nufft.idft", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; @@ -23925,21 +24444,21 @@ static PyObject *__pyx_pf_7fastkde_5nufft_2idft(CYTHON_UNUSED PyObject *__pyx_se * #******************************************************************************* * @cython.boundscheck(False) * cdef inline int unravelIndex( \ # <<<<<<<<<<<<<< - * np.int_t i, \ - * np.int_t [:] frequencySizes, \ + * np.int64_t i, \ + * np.int64_t [:] frequencySizes, \ */ -static CYTHON_INLINE int __pyx_f_7fastkde_5nufft_unravelIndex(__pyx_t_5numpy_int_t __pyx_v_i, __Pyx_memviewslice __pyx_v_frequencySizes, __Pyx_memviewslice __pyx_v_dimInds, __pyx_t_5numpy_int_t __pyx_v_ndims) { - __pyx_t_5numpy_int_t __pyx_v_n; - __pyx_t_5numpy_int_t __pyx_v_iDum; - __pyx_t_5numpy_int_t __pyx_v_hyperSize; +static CYTHON_INLINE int __pyx_f_7fastkde_5nufft_unravelIndex(__pyx_t_5numpy_int64_t __pyx_v_i, __Pyx_memviewslice __pyx_v_frequencySizes, __Pyx_memviewslice __pyx_v_dimInds, __pyx_t_5numpy_int64_t __pyx_v_ndims) { + __pyx_t_5numpy_int64_t __pyx_v_n; + __pyx_t_5numpy_int64_t __pyx_v_iDum; + __pyx_t_5numpy_int64_t __pyx_v_hyperSize; int __pyx_r; - __pyx_t_5numpy_int_t __pyx_t_1; - __pyx_t_5numpy_int_t __pyx_t_2; - __pyx_t_5numpy_int_t __pyx_t_3; - Py_ssize_t __pyx_t_4; + __pyx_t_5numpy_int64_t __pyx_t_1; + __pyx_t_5numpy_int64_t __pyx_t_2; + __pyx_t_5numpy_int64_t __pyx_t_3; + __pyx_t_5numpy_int64_t __pyx_t_4; int __pyx_t_5; - __pyx_t_5numpy_int_t __pyx_t_6; + __pyx_t_5numpy_int64_t __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; @@ -23948,7 +24467,7 @@ static CYTHON_INLINE int __pyx_f_7fastkde_5nufft_unravelIndex(__pyx_t_5numpy_int #endif /* "fastkde/nufft.pyx":424 - * cdef np.int_t hyperSize + * cdef np.int64_t hyperSize * * hyperSize = 1 # <<<<<<<<<<<<<< * for n in range(1,ndims): @@ -23977,7 +24496,7 @@ static CYTHON_INLINE int __pyx_f_7fastkde_5nufft_unravelIndex(__pyx_t_5numpy_int */ __pyx_t_4 = __pyx_v_n; if (__pyx_t_4 < 0) __pyx_t_4 += __pyx_v_frequencySizes.shape[0]; - __pyx_v_hyperSize = (__pyx_v_hyperSize * (*((__pyx_t_5numpy_int_t *) ( /* dim=0 */ (__pyx_v_frequencySizes.data + __pyx_t_4 * __pyx_v_frequencySizes.strides[0]) )))); + __pyx_v_hyperSize = (__pyx_v_hyperSize * (*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_frequencySizes.data + __pyx_t_4 * __pyx_v_frequencySizes.strides[0]) )))); } /* "fastkde/nufft.pyx":428 @@ -23985,7 +24504,7 @@ static CYTHON_INLINE int __pyx_f_7fastkde_5nufft_unravelIndex(__pyx_t_5numpy_int * * iDum = i # <<<<<<<<<<<<<< * for n in range(ndims): - * dimInds[n] = floor(( iDum)/( hyperSize)) + * dimInds[n] = floor(( iDum)/( hyperSize)) */ __pyx_v_iDum = __pyx_v_i; @@ -23993,7 +24512,7 @@ static CYTHON_INLINE int __pyx_f_7fastkde_5nufft_unravelIndex(__pyx_t_5numpy_int * * iDum = i * for n in range(ndims): # <<<<<<<<<<<<<< - * dimInds[n] = floor(( iDum)/( hyperSize)) + * dimInds[n] = floor(( iDum)/( hyperSize)) * iDum -= dimInds[n]*hyperSize */ __pyx_t_1 = __pyx_v_ndims; @@ -24004,7 +24523,7 @@ static CYTHON_INLINE int __pyx_f_7fastkde_5nufft_unravelIndex(__pyx_t_5numpy_int /* "fastkde/nufft.pyx":430 * iDum = i * for n in range(ndims): - * dimInds[n] = floor(( iDum)/( hyperSize)) # <<<<<<<<<<<<<< + * dimInds[n] = floor(( iDum)/( hyperSize)) # <<<<<<<<<<<<<< * iDum -= dimInds[n]*hyperSize * if n < (ndims-1): */ @@ -24020,21 +24539,21 @@ static CYTHON_INLINE int __pyx_f_7fastkde_5nufft_unravelIndex(__pyx_t_5numpy_int } __pyx_t_4 = __pyx_v_n; if (__pyx_t_4 < 0) __pyx_t_4 += __pyx_v_dimInds.shape[0]; - *((__pyx_t_5numpy_int_t *) ( /* dim=0 */ (__pyx_v_dimInds.data + __pyx_t_4 * __pyx_v_dimInds.strides[0]) )) = ((__pyx_t_5numpy_int_t)floor((((double)__pyx_v_iDum) / ((double)__pyx_v_hyperSize)))); + *((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_dimInds.data + __pyx_t_4 * __pyx_v_dimInds.strides[0]) )) = ((__pyx_t_5numpy_int64_t)floor((((double)__pyx_v_iDum) / ((double)__pyx_v_hyperSize)))); /* "fastkde/nufft.pyx":431 * for n in range(ndims): - * dimInds[n] = floor(( iDum)/( hyperSize)) + * dimInds[n] = floor(( iDum)/( hyperSize)) * iDum -= dimInds[n]*hyperSize # <<<<<<<<<<<<<< * if n < (ndims-1): * hyperSize /= frequencySizes[n+1] */ __pyx_t_4 = __pyx_v_n; if (__pyx_t_4 < 0) __pyx_t_4 += __pyx_v_dimInds.shape[0]; - __pyx_v_iDum = (__pyx_v_iDum - ((*((__pyx_t_5numpy_int_t *) ( /* dim=0 */ (__pyx_v_dimInds.data + __pyx_t_4 * __pyx_v_dimInds.strides[0]) ))) * __pyx_v_hyperSize)); + __pyx_v_iDum = (__pyx_v_iDum - ((*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_dimInds.data + __pyx_t_4 * __pyx_v_dimInds.strides[0]) ))) * __pyx_v_hyperSize)); /* "fastkde/nufft.pyx":432 - * dimInds[n] = floor(( iDum)/( hyperSize)) + * dimInds[n] = floor(( iDum)/( hyperSize)) * iDum -= dimInds[n]*hyperSize * if n < (ndims-1): # <<<<<<<<<<<<<< * hyperSize /= frequencySizes[n+1] @@ -24052,7 +24571,7 @@ static CYTHON_INLINE int __pyx_f_7fastkde_5nufft_unravelIndex(__pyx_t_5numpy_int */ __pyx_t_4 = (__pyx_v_n + 1); if (__pyx_t_4 < 0) __pyx_t_4 += __pyx_v_frequencySizes.shape[0]; - __pyx_t_6 = (*((__pyx_t_5numpy_int_t *) ( /* dim=0 */ (__pyx_v_frequencySizes.data + __pyx_t_4 * __pyx_v_frequencySizes.strides[0]) ))); + __pyx_t_6 = (*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_frequencySizes.data + __pyx_t_4 * __pyx_v_frequencySizes.strides[0]) ))); if (unlikely(__pyx_t_6 == 0)) { #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); @@ -24063,7 +24582,7 @@ static CYTHON_INLINE int __pyx_f_7fastkde_5nufft_unravelIndex(__pyx_t_5numpy_int #endif __PYX_ERR(0, 433, __pyx_L1_error) } - else if (sizeof(__pyx_t_5numpy_int_t) == sizeof(long) && (!(((__pyx_t_5numpy_int_t)-1) > 0)) && unlikely(__pyx_t_6 == (__pyx_t_5numpy_int_t)-1) && unlikely(__Pyx_UNARY_NEG_WOULD_OVERFLOW(__pyx_v_hyperSize))) { + else if (sizeof(__pyx_t_5numpy_int64_t) == sizeof(long) && (!(((__pyx_t_5numpy_int64_t)-1) > 0)) && unlikely(__pyx_t_6 == (__pyx_t_5numpy_int64_t)-1) && unlikely(__Pyx_UNARY_NEG_WOULD_OVERFLOW(__pyx_v_hyperSize))) { #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif @@ -24073,10 +24592,10 @@ static CYTHON_INLINE int __pyx_f_7fastkde_5nufft_unravelIndex(__pyx_t_5numpy_int #endif __PYX_ERR(0, 433, __pyx_L1_error) } - __pyx_v_hyperSize = __Pyx_div___pyx_t_5numpy_int_t(__pyx_v_hyperSize, __pyx_t_6); + __pyx_v_hyperSize = __Pyx_div___pyx_t_5numpy_int64_t(__pyx_v_hyperSize, __pyx_t_6); /* "fastkde/nufft.pyx":432 - * dimInds[n] = floor(( iDum)/( hyperSize)) + * dimInds[n] = floor(( iDum)/( hyperSize)) * iDum -= dimInds[n]*hyperSize * if n < (ndims-1): # <<<<<<<<<<<<<< * hyperSize /= frequencySizes[n+1] @@ -24112,8 +24631,8 @@ static CYTHON_INLINE int __pyx_f_7fastkde_5nufft_unravelIndex(__pyx_t_5numpy_int * #******************************************************************************* * @cython.boundscheck(False) * cdef inline int unravelIndex( \ # <<<<<<<<<<<<<< - * np.int_t i, \ - * np.int_t [:] frequencySizes, \ + * np.int64_t i, \ + * np.int64_t [:] frequencySizes, \ */ /* function exit code */ @@ -24134,20 +24653,20 @@ static CYTHON_INLINE int __pyx_f_7fastkde_5nufft_unravelIndex(__pyx_t_5numpy_int * #******************************************************************************* * @cython.boundscheck(False) * cdef inline int ravelIndex( \ # <<<<<<<<<<<<<< - * np.int_t [:] frequencySizes, \ - * np.int_t [:] dimInds, \ + * np.int64_t [:] frequencySizes, \ + * np.int64_t [:] dimInds, \ */ -static CYTHON_INLINE int __pyx_f_7fastkde_5nufft_ravelIndex(__Pyx_memviewslice __pyx_v_frequencySizes, __Pyx_memviewslice __pyx_v_dimInds, __pyx_t_5numpy_int_t __pyx_v_ndims) { - __pyx_t_5numpy_int_t __pyx_v_n; - __pyx_t_5numpy_int_t __pyx_v_hyperSize; - __pyx_t_5numpy_int_t __pyx_v_i; +static CYTHON_INLINE int __pyx_f_7fastkde_5nufft_ravelIndex(__Pyx_memviewslice __pyx_v_frequencySizes, __Pyx_memviewslice __pyx_v_dimInds, __pyx_t_5numpy_int64_t __pyx_v_ndims) { + __pyx_t_5numpy_int64_t __pyx_v_n; + __pyx_t_5numpy_int64_t __pyx_v_hyperSize; + __pyx_t_5numpy_int64_t __pyx_v_i; int __pyx_r; - __pyx_t_5numpy_int_t __pyx_t_1; - Py_ssize_t __pyx_t_2; + __pyx_t_5numpy_int64_t __pyx_t_1; + __pyx_t_5numpy_int64_t __pyx_t_2; /* "fastkde/nufft.pyx":456 - * cdef np.int_t i + * cdef np.int64_t i * * hyperSize = 1 # <<<<<<<<<<<<<< * i = 0 @@ -24171,7 +24690,7 @@ static CYTHON_INLINE int __pyx_f_7fastkde_5nufft_ravelIndex(__Pyx_memviewslice _ * i += hyperSize*dimInds[n] * hyperSize *= frequencySizes[n] */ - for (__pyx_t_1 = (__pyx_v_ndims - 1); __pyx_t_1 > -1L; __pyx_t_1-=1) { + for (__pyx_t_1 = (__pyx_v_ndims - 1); __pyx_t_1 > -1LL; __pyx_t_1-=1) { __pyx_v_n = __pyx_t_1; /* "fastkde/nufft.pyx":459 @@ -24183,7 +24702,7 @@ static CYTHON_INLINE int __pyx_f_7fastkde_5nufft_ravelIndex(__Pyx_memviewslice _ */ __pyx_t_2 = __pyx_v_n; if (__pyx_t_2 < 0) __pyx_t_2 += __pyx_v_dimInds.shape[0]; - __pyx_v_i = (__pyx_v_i + (__pyx_v_hyperSize * (*((__pyx_t_5numpy_int_t *) ( /* dim=0 */ (__pyx_v_dimInds.data + __pyx_t_2 * __pyx_v_dimInds.strides[0]) ))))); + __pyx_v_i = (__pyx_v_i + (__pyx_v_hyperSize * (*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_dimInds.data + __pyx_t_2 * __pyx_v_dimInds.strides[0]) ))))); /* "fastkde/nufft.pyx":460 * for n in range(ndims-1,-1,-1): @@ -24194,7 +24713,7 @@ static CYTHON_INLINE int __pyx_f_7fastkde_5nufft_ravelIndex(__Pyx_memviewslice _ */ __pyx_t_2 = __pyx_v_n; if (__pyx_t_2 < 0) __pyx_t_2 += __pyx_v_frequencySizes.shape[0]; - __pyx_v_hyperSize = (__pyx_v_hyperSize * (*((__pyx_t_5numpy_int_t *) ( /* dim=0 */ (__pyx_v_frequencySizes.data + __pyx_t_2 * __pyx_v_frequencySizes.strides[0]) )))); + __pyx_v_hyperSize = (__pyx_v_hyperSize * (*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_frequencySizes.data + __pyx_t_2 * __pyx_v_frequencySizes.strides[0]) )))); } /* "fastkde/nufft.pyx":461 @@ -24211,8 +24730,8 @@ static CYTHON_INLINE int __pyx_f_7fastkde_5nufft_ravelIndex(__Pyx_memviewslice _ * #******************************************************************************* * @cython.boundscheck(False) * cdef inline int ravelIndex( \ # <<<<<<<<<<<<<< - * np.int_t [:] frequencySizes, \ - * np.int_t [:] dimInds, \ + * np.int64_t [:] frequencySizes, \ + * np.int64_t [:] dimInds, \ */ /* function exit code */ @@ -24337,7 +24856,7 @@ static PyObject *__pyx_pf_7fastkde_5nufft_4calc_x_from_t(CYTHON_UNUSED PyObject Py_ssize_t __pyx_t_6; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; - int __pyx_t_9; + unsigned int __pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; @@ -24587,7 +25106,7 @@ static PyObject *__pyx_pf_7fastkde_5nufft_6calc_t_from_x(CYTHON_UNUSED PyObject Py_ssize_t __pyx_t_6; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; - int __pyx_t_9; + unsigned int __pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; @@ -24938,38 +25457,39 @@ static PyArrayObject *__pyx_f_7fastkde_5nufft_dft_points(__Pyx_memviewslice __py int __pyx_v_t; int __pyx_v_iNotMissing; __Pyx_memviewslice __pyx_v_frequencySizes = { 0, 0, { 0 }, { 0 }, { 0 } }; - __pyx_t_5numpy_int_t __pyx_v_freqSpaceSize; + __pyx_t_5numpy_int64_t __pyx_v_freqSpaceSize; CYTHON_UNUSED __Pyx_memviewslice __pyx_v_DFT = { 0, 0, { 0 }, { 0 }, { 0 } }; __Pyx_memviewslice __pyx_v_dimInds = { 0, 0, { 0 }, { 0 }, { 0 } }; - __pyx_t_5numpy_int_t __pyx_v_j; + __pyx_t_5numpy_int64_t __pyx_v_j; PyArrayObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; + unsigned int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; int __pyx_t_9; - __Pyx_memviewslice __pyx_t_10 = { 0, 0, { 0 }, { 0 }, { 0 } }; - PyObject *__pyx_t_11 = NULL; - __Pyx_memviewslice __pyx_t_12 = { 0, 0, { 0 }, { 0 }, { 0 } }; - int __pyx_t_13; + int __pyx_t_10; + __Pyx_memviewslice __pyx_t_11 = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyObject *__pyx_t_12 = NULL; + __Pyx_memviewslice __pyx_t_13 = { 0, 0, { 0 }, { 0 }, { 0 } }; int __pyx_t_14; int __pyx_t_15; int __pyx_t_16; int __pyx_t_17; - Py_ssize_t __pyx_t_18; + int __pyx_t_18; Py_ssize_t __pyx_t_19; - __pyx_t_5numpy_int_t __pyx_t_20; - __Pyx_memviewslice __pyx_t_21 = { 0, 0, { 0 }, { 0 }, { 0 } }; - __pyx_t_5numpy_int_t __pyx_t_22; - __pyx_t_5numpy_int_t __pyx_t_23; - Py_ssize_t __pyx_t_24; - Py_ssize_t __pyx_t_25; + Py_ssize_t __pyx_t_20; + __pyx_t_5numpy_int64_t __pyx_t_21; + __Pyx_memviewslice __pyx_t_22 = { 0, 0, { 0 }, { 0 }, { 0 } }; + __pyx_t_5numpy_int64_t __pyx_t_23; + __pyx_t_5numpy_int64_t __pyx_t_24; + __pyx_t_5numpy_int64_t __pyx_t_25; Py_ssize_t __pyx_t_26; + Py_ssize_t __pyx_t_27; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; @@ -25072,9 +25592,9 @@ static PyArrayObject *__pyx_f_7fastkde_5nufft_dft_points(__Pyx_memviewslice __py __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 540, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 540, __pyx_L3_error) + __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 540, __pyx_L3_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_v_numDimensions = __pyx_t_4; + __pyx_v_numDimensions = __pyx_t_9; /* "fastkde/nufft.pyx":539 * #Get the shape of frequency_grids @@ -25391,9 +25911,9 @@ static PyArrayObject *__pyx_f_7fastkde_5nufft_dft_points(__Pyx_memviewslice __py __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_t_3, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 556, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 556, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 556, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(__pyx_t_9)) { + if (unlikely(__pyx_t_10)) { /* "fastkde/nufft.pyx":557 * @@ -25426,9 +25946,9 @@ static PyArrayObject *__pyx_f_7fastkde_5nufft_dft_points(__Pyx_memviewslice __py */ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_outputShape, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 560, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 560, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 560, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_v_numOutputPoints = __pyx_t_4; + __pyx_v_numOutputPoints = __pyx_t_9; /* "fastkde/nufft.pyx":563 * @@ -25462,11 +25982,11 @@ static PyArrayObject *__pyx_f_7fastkde_5nufft_dft_points(__Pyx_memviewslice __py __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_10 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float_t(__pyx_t_8, PyBUF_WRITABLE); if (unlikely(!__pyx_t_10.memview)) __PYX_ERR(0, 563, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float_t(__pyx_t_8, PyBUF_WRITABLE); if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 563, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_v_iDFT = __pyx_t_10; - __pyx_t_10.memview = NULL; - __pyx_t_10.data = NULL; + __pyx_v_iDFT = __pyx_t_11; + __pyx_t_11.memview = NULL; + __pyx_t_11.data = NULL; /* "fastkde/nufft.pyx":570 * cdef double expArg @@ -25517,16 +26037,16 @@ static PyArrayObject *__pyx_f_7fastkde_5nufft_dft_points(__Pyx_memviewslice __py __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_8, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 575, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 575, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 575, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_v_ntMax = __pyx_t_4; + __pyx_v_ntMax = __pyx_t_9; /* "fastkde/nufft.pyx":580 * # Calculate the size of the frequency spaces * #******************************************** * vprint("Getting the size of the frequency spaces",be_verbose) # <<<<<<<<<<<<<< * cdef int t,iNotMissing - * cdef np.int_t [:] frequencySizes = np.zeros([numDimensions],dtype=np.int_) + * cdef np.int64_t [:] frequencySizes = np.zeros([numDimensions],dtype=np.int_) */ __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_vprint); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 580, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); @@ -25557,7 +26077,7 @@ static PyArrayObject *__pyx_f_7fastkde_5nufft_dft_points(__Pyx_memviewslice __py /* "fastkde/nufft.pyx":582 * vprint("Getting the size of the frequency spaces",be_verbose) * cdef int t,iNotMissing - * cdef np.int_t [:] frequencySizes = np.zeros([numDimensions],dtype=np.int_) # <<<<<<<<<<<<<< + * cdef np.int64_t [:] frequencySizes = np.zeros([numDimensions],dtype=np.int_) # <<<<<<<<<<<<<< * * for n in range(numDimensions): */ @@ -25582,33 +26102,33 @@ static PyArrayObject *__pyx_f_7fastkde_5nufft_dft_points(__Pyx_memviewslice __py __Pyx_GOTREF(__pyx_t_2); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 582, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_int); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 582, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_int); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 582, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_11) < 0) __PYX_ERR(0, 582, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 582, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_12) < 0) __PYX_ERR(0, 582, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 582, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int_t(__pyx_t_11, PyBUF_WRITABLE); if (unlikely(!__pyx_t_12.memview)) __PYX_ERR(0, 582, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_v_frequencySizes = __pyx_t_12; - __pyx_t_12.memview = NULL; - __pyx_t_12.data = NULL; + __pyx_t_13 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(__pyx_t_12, PyBUF_WRITABLE); if (unlikely(!__pyx_t_13.memview)) __PYX_ERR(0, 582, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_v_frequencySizes = __pyx_t_13; + __pyx_t_13.memview = NULL; + __pyx_t_13.data = NULL; /* "fastkde/nufft.pyx":584 - * cdef np.int_t [:] frequencySizes = np.zeros([numDimensions],dtype=np.int_) + * cdef np.int64_t [:] frequencySizes = np.zeros([numDimensions],dtype=np.int_) * * for n in range(numDimensions): # <<<<<<<<<<<<<< * iNotMissing = 0 * for t in range(ntMax): */ - __pyx_t_4 = __pyx_v_numDimensions; - __pyx_t_13 = __pyx_t_4; - for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) { - __pyx_v_n = __pyx_t_14; + __pyx_t_9 = __pyx_v_numDimensions; + __pyx_t_14 = __pyx_t_9; + for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_14; __pyx_t_15+=1) { + __pyx_v_n = __pyx_t_15; /* "fastkde/nufft.pyx":585 * @@ -25626,10 +26146,10 @@ static PyArrayObject *__pyx_f_7fastkde_5nufft_dft_points(__Pyx_memviewslice __py * if frequency_grids[n,t] != missing_freq_val: * iNotMissing += 1 */ - __pyx_t_15 = __pyx_v_ntMax; - __pyx_t_16 = __pyx_t_15; - for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) { - __pyx_v_t = __pyx_t_17; + __pyx_t_16 = __pyx_v_ntMax; + __pyx_t_17 = __pyx_t_16; + for (__pyx_t_18 = 0; __pyx_t_18 < __pyx_t_17; __pyx_t_18+=1) { + __pyx_v_t = __pyx_t_18; /* "fastkde/nufft.pyx":587 * iNotMissing = 0 @@ -25638,19 +26158,19 @@ static PyArrayObject *__pyx_f_7fastkde_5nufft_dft_points(__Pyx_memviewslice __py * iNotMissing += 1 * if iNotMissing != 0: */ - __pyx_t_18 = __pyx_v_n; - __pyx_t_19 = __pyx_v_t; - if (__pyx_t_18 < 0) __pyx_t_18 += __pyx_v_frequency_grids.shape[0]; - if (__pyx_t_19 < 0) __pyx_t_19 += __pyx_v_frequency_grids.shape[1]; - __pyx_t_9 = ((*((__pyx_t_5numpy_float_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_frequency_grids.data + __pyx_t_18 * __pyx_v_frequency_grids.strides[0]) ) + __pyx_t_19 * __pyx_v_frequency_grids.strides[1]) ))) != __pyx_v_missing_freq_val); - if (__pyx_t_9) { + __pyx_t_19 = __pyx_v_n; + __pyx_t_20 = __pyx_v_t; + if (__pyx_t_19 < 0) __pyx_t_19 += __pyx_v_frequency_grids.shape[0]; + if (__pyx_t_20 < 0) __pyx_t_20 += __pyx_v_frequency_grids.shape[1]; + __pyx_t_10 = ((*((__pyx_t_5numpy_float_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_frequency_grids.data + __pyx_t_19 * __pyx_v_frequency_grids.strides[0]) ) + __pyx_t_20 * __pyx_v_frequency_grids.strides[1]) ))) != __pyx_v_missing_freq_val); + if (__pyx_t_10) { /* "fastkde/nufft.pyx":588 * for t in range(ntMax): * if frequency_grids[n,t] != missing_freq_val: * iNotMissing += 1 # <<<<<<<<<<<<<< * if iNotMissing != 0: - * frequencySizes[n] = iNotMissing + * frequencySizes[n] = iNotMissing */ __pyx_v_iNotMissing = (__pyx_v_iNotMissing + 1); @@ -25668,45 +26188,45 @@ static PyArrayObject *__pyx_f_7fastkde_5nufft_dft_points(__Pyx_memviewslice __py * if frequency_grids[n,t] != missing_freq_val: * iNotMissing += 1 * if iNotMissing != 0: # <<<<<<<<<<<<<< - * frequencySizes[n] = iNotMissing + * frequencySizes[n] = iNotMissing * else: */ - __pyx_t_9 = (__pyx_v_iNotMissing != 0); - if (likely(__pyx_t_9)) { + __pyx_t_10 = (__pyx_v_iNotMissing != 0); + if (likely(__pyx_t_10)) { /* "fastkde/nufft.pyx":590 * iNotMissing += 1 * if iNotMissing != 0: - * frequencySizes[n] = iNotMissing # <<<<<<<<<<<<<< + * frequencySizes[n] = iNotMissing # <<<<<<<<<<<<<< * else: * raise ValueError("Some frequencies in frequency_grids have no valid points") */ - __pyx_t_19 = __pyx_v_n; - if (__pyx_t_19 < 0) __pyx_t_19 += __pyx_v_frequencySizes.shape[0]; - *((__pyx_t_5numpy_int_t *) ( /* dim=0 */ (__pyx_v_frequencySizes.data + __pyx_t_19 * __pyx_v_frequencySizes.strides[0]) )) = ((__pyx_t_5numpy_int_t)__pyx_v_iNotMissing); + __pyx_t_20 = __pyx_v_n; + if (__pyx_t_20 < 0) __pyx_t_20 += __pyx_v_frequencySizes.shape[0]; + *((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_frequencySizes.data + __pyx_t_20 * __pyx_v_frequencySizes.strides[0]) )) = ((__pyx_t_5numpy_int64_t)__pyx_v_iNotMissing); /* "fastkde/nufft.pyx":589 * if frequency_grids[n,t] != missing_freq_val: * iNotMissing += 1 * if iNotMissing != 0: # <<<<<<<<<<<<<< - * frequencySizes[n] = iNotMissing + * frequencySizes[n] = iNotMissing * else: */ goto __pyx_L33; } /* "fastkde/nufft.pyx":592 - * frequencySizes[n] = iNotMissing + * frequencySizes[n] = iNotMissing * else: * raise ValueError("Some frequencies in frequency_grids have no valid points") # <<<<<<<<<<<<<< * * #Get the total size of the frequency space */ /*else*/ { - __pyx_t_11 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 592, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __Pyx_Raise(__pyx_t_11, 0, 0, 0); - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_12 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 592, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_Raise(__pyx_t_12, 0, 0, 0); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __PYX_ERR(0, 592, __pyx_L1_error) } __pyx_L33:; @@ -25715,7 +26235,7 @@ static PyArrayObject *__pyx_f_7fastkde_5nufft_dft_points(__Pyx_memviewslice __py /* "fastkde/nufft.pyx":595 * * #Get the total size of the frequency space - * cdef np.int_t freqSpaceSize = np.prod(frequencySizes) # <<<<<<<<<<<<<< + * cdef np.int64_t freqSpaceSize = np.prod(frequencySizes) # <<<<<<<<<<<<<< * * #Pre-declare and allocate a raveled form of the DFT */ @@ -25724,7 +26244,7 @@ static PyArrayObject *__pyx_f_7fastkde_5nufft_dft_points(__Pyx_memviewslice __py __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_prod); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 595, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __pyx_memoryview_fromslice(__pyx_v_frequencySizes, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int_t, 0);; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 595, __pyx_L1_error) + __pyx_t_2 = __pyx_memoryview_fromslice(__pyx_v_frequencySizes, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int64_t, 0);; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 595, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_8 = NULL; __pyx_t_4 = 0; @@ -25742,16 +26262,16 @@ static PyArrayObject *__pyx_f_7fastkde_5nufft_dft_points(__Pyx_memviewslice __py #endif { PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_2}; - __pyx_t_11 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); + __pyx_t_12 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 595, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); + if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 595, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - __pyx_t_20 = __Pyx_PyInt_As_npy_long(__pyx_t_11); if (unlikely((__pyx_t_20 == ((npy_long)-1)) && PyErr_Occurred())) __PYX_ERR(0, 595, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_v_freqSpaceSize = __pyx_t_20; + __pyx_t_21 = __Pyx_PyInt_As_npy_int64(__pyx_t_12); if (unlikely((__pyx_t_21 == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 595, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_v_freqSpaceSize = __pyx_t_21; /* "fastkde/nufft.pyx":598 * @@ -25760,22 +26280,22 @@ static PyArrayObject *__pyx_f_7fastkde_5nufft_dft_points(__Pyx_memviewslice __py * * #Pre declare a dimension index vector */ - __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_np); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 598, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 598, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_np); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 598, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 598, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_t_11 = __Pyx_PyInt_From_npy_long(__pyx_v_freqSpaceSize); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 598, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = __Pyx_PyInt_From_npy_int64(__pyx_v_freqSpaceSize); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 598, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 598, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_GIVEREF(__pyx_t_11); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_11)) __PYX_ERR(0, 598, __pyx_L1_error); - __pyx_t_11 = 0; - __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 598, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); + __Pyx_GIVEREF(__pyx_t_12); + if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_12)) __PYX_ERR(0, 598, __pyx_L1_error); + __pyx_t_12 = 0; + __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 598, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_2)) __PYX_ERR(0, 598, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_2)) __PYX_ERR(0, 598, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 598, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); @@ -25786,21 +26306,21 @@ static PyArrayObject *__pyx_f_7fastkde_5nufft_dft_points(__Pyx_memviewslice __py __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_3) < 0) __PYX_ERR(0, 598, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_11, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 598, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_12, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 598, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_21 = __Pyx_PyObject_to_MemoryviewSlice_ds___pyx_t_double_complex(__pyx_t_3, PyBUF_WRITABLE); if (unlikely(!__pyx_t_21.memview)) __PYX_ERR(0, 598, __pyx_L1_error) + __pyx_t_22 = __Pyx_PyObject_to_MemoryviewSlice_ds___pyx_t_double_complex(__pyx_t_3, PyBUF_WRITABLE); if (unlikely(!__pyx_t_22.memview)) __PYX_ERR(0, 598, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_v_DFT = __pyx_t_21; - __pyx_t_21.memview = NULL; - __pyx_t_21.data = NULL; + __pyx_v_DFT = __pyx_t_22; + __pyx_t_22.memview = NULL; + __pyx_t_22.data = NULL; /* "fastkde/nufft.pyx":601 * * #Pre declare a dimension index vector - * cdef np.int_t [:] dimInds = np.zeros([numDimensions],dtype=np.int_) # <<<<<<<<<<<<<< + * cdef np.int64_t [:] dimInds = np.zeros([numDimensions],dtype=np.int_) # <<<<<<<<<<<<<< * * vprint("Calculating the DFT",be_verbose) */ @@ -25811,66 +26331,66 @@ static PyArrayObject *__pyx_f_7fastkde_5nufft_dft_points(__Pyx_memviewslice __py __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_numDimensions); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 601, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_11 = PyList_New(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 601, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); + __pyx_t_12 = PyList_New(1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 601, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyList_SET_ITEM(__pyx_t_11, 0, __pyx_t_3)) __PYX_ERR(0, 601, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_12, 0, __pyx_t_3)) __PYX_ERR(0, 601, __pyx_L1_error); __pyx_t_3 = 0; __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 601, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_GIVEREF(__pyx_t_11); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_11)) __PYX_ERR(0, 601, __pyx_L1_error); - __pyx_t_11 = 0; - __pyx_t_11 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 601, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); + __Pyx_GIVEREF(__pyx_t_12); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_12)) __PYX_ERR(0, 601, __pyx_L1_error); + __pyx_t_12 = 0; + __pyx_t_12 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 601, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 601, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_int); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 601, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_dtype, __pyx_t_8) < 0) __PYX_ERR(0, 601, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_dtype, __pyx_t_8) < 0) __PYX_ERR(0, 601, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_11); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 601, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_12); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 601, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int_t(__pyx_t_8, PyBUF_WRITABLE); if (unlikely(!__pyx_t_12.memview)) __PYX_ERR(0, 601, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_13 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(__pyx_t_8, PyBUF_WRITABLE); if (unlikely(!__pyx_t_13.memview)) __PYX_ERR(0, 601, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_v_dimInds = __pyx_t_12; - __pyx_t_12.memview = NULL; - __pyx_t_12.data = NULL; + __pyx_v_dimInds = __pyx_t_13; + __pyx_t_13.memview = NULL; + __pyx_t_13.data = NULL; /* "fastkde/nufft.pyx":603 - * cdef np.int_t [:] dimInds = np.zeros([numDimensions],dtype=np.int_) + * cdef np.int64_t [:] dimInds = np.zeros([numDimensions],dtype=np.int_) * * vprint("Calculating the DFT",be_verbose) # <<<<<<<<<<<<<< * with nogil: * for i in range(numOutputPoints): */ - __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_vprint); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 603, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); + __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_vprint); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 603, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_11))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_11); + if (unlikely(PyMethod_Check(__pyx_t_12))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_12); if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_11, function); + __Pyx_DECREF_SET(__pyx_t_12, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_kp_s_Calculating_the_DFT, __pyx_v_be_verbose}; - __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_11, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); + __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_12, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 603, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; } __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; @@ -25897,10 +26417,10 @@ static PyArrayObject *__pyx_f_7fastkde_5nufft_dft_points(__Pyx_memviewslice __py * myiDFT = 0.0 * */ - __pyx_t_4 = __pyx_v_numOutputPoints; - __pyx_t_13 = __pyx_t_4; - for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) { - __pyx_v_i = __pyx_t_14; + __pyx_t_9 = __pyx_v_numOutputPoints; + __pyx_t_14 = __pyx_t_9; + for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_14; __pyx_t_15+=1) { + __pyx_v_i = __pyx_t_15; /* "fastkde/nufft.pyx":606 * with nogil: @@ -25918,10 +26438,10 @@ static PyArrayObject *__pyx_f_7fastkde_5nufft_dft_points(__Pyx_memviewslice __py * unravelIndex(j,frequencySizes,dimInds,numDimensions) * expArg = 0.0 */ - __pyx_t_20 = __pyx_v_freqSpaceSize; - __pyx_t_22 = __pyx_t_20; - for (__pyx_t_23 = 0; __pyx_t_23 < __pyx_t_22; __pyx_t_23+=1) { - __pyx_v_j = __pyx_t_23; + __pyx_t_21 = __pyx_v_freqSpaceSize; + __pyx_t_23 = __pyx_t_21; + for (__pyx_t_24 = 0; __pyx_t_24 < __pyx_t_23; __pyx_t_24+=1) { + __pyx_v_j = __pyx_t_24; /* "fastkde/nufft.pyx":610 * @@ -25930,7 +26450,7 @@ static PyArrayObject *__pyx_f_7fastkde_5nufft_dft_points(__Pyx_memviewslice __py * expArg = 0.0 * */ - __pyx_t_15 = __pyx_f_7fastkde_5nufft_unravelIndex(__pyx_v_j, __pyx_v_frequencySizes, __pyx_v_dimInds, __pyx_v_numDimensions); if (unlikely(__pyx_t_15 == ((int)-1) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 610, __pyx_L35_error) + __pyx_t_16 = __pyx_f_7fastkde_5nufft_unravelIndex(__pyx_v_j, __pyx_v_frequencySizes, __pyx_v_dimInds, __pyx_v_numDimensions); if (unlikely(__pyx_t_16 == ((int)-1) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 610, __pyx_L35_error) /* "fastkde/nufft.pyx":611 * for j in range(freqSpaceSize): @@ -25948,10 +26468,10 @@ static PyArrayObject *__pyx_f_7fastkde_5nufft_dft_points(__Pyx_memviewslice __py * * expArg = expArg +(frequency_grids[k,dimInds[k]] * outputPoints[k,i]) */ - __pyx_t_15 = __pyx_v_numDimensions; - __pyx_t_16 = __pyx_t_15; - for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) { - __pyx_v_k = __pyx_t_17; + __pyx_t_16 = __pyx_v_numDimensions; + __pyx_t_17 = __pyx_t_16; + for (__pyx_t_18 = 0; __pyx_t_18 < __pyx_t_17; __pyx_t_18+=1) { + __pyx_v_k = __pyx_t_18; /* "fastkde/nufft.pyx":615 * for k in range(numDimensions): @@ -25960,17 +26480,17 @@ static PyArrayObject *__pyx_f_7fastkde_5nufft_dft_points(__Pyx_memviewslice __py * * #Calculate the flattened array index of the current point */ + __pyx_t_20 = __pyx_v_k; + if (__pyx_t_20 < 0) __pyx_t_20 += __pyx_v_dimInds.shape[0]; __pyx_t_19 = __pyx_v_k; - if (__pyx_t_19 < 0) __pyx_t_19 += __pyx_v_dimInds.shape[0]; - __pyx_t_18 = __pyx_v_k; - __pyx_t_24 = (*((__pyx_t_5numpy_int_t *) ( /* dim=0 */ (__pyx_v_dimInds.data + __pyx_t_19 * __pyx_v_dimInds.strides[0]) ))); - if (__pyx_t_18 < 0) __pyx_t_18 += __pyx_v_frequency_grids.shape[0]; - if (__pyx_t_24 < 0) __pyx_t_24 += __pyx_v_frequency_grids.shape[1]; - __pyx_t_25 = __pyx_v_k; - __pyx_t_26 = __pyx_v_i; - if (__pyx_t_25 < 0) __pyx_t_25 += __pyx_v_outputPoints.shape[0]; - if (__pyx_t_26 < 0) __pyx_t_26 += __pyx_v_outputPoints.shape[1]; - __pyx_v_expArg = (__pyx_v_expArg + ((*((__pyx_t_5numpy_float_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_frequency_grids.data + __pyx_t_18 * __pyx_v_frequency_grids.strides[0]) ) + __pyx_t_24 * __pyx_v_frequency_grids.strides[1]) ))) * (*((__pyx_t_5numpy_float_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_outputPoints.data + __pyx_t_25 * __pyx_v_outputPoints.strides[0]) ) + __pyx_t_26 * __pyx_v_outputPoints.strides[1]) ))))); + __pyx_t_25 = (*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_dimInds.data + __pyx_t_20 * __pyx_v_dimInds.strides[0]) ))); + if (__pyx_t_19 < 0) __pyx_t_19 += __pyx_v_frequency_grids.shape[0]; + if (__pyx_t_25 < 0) __pyx_t_25 += __pyx_v_frequency_grids.shape[1]; + __pyx_t_26 = __pyx_v_k; + __pyx_t_27 = __pyx_v_i; + if (__pyx_t_26 < 0) __pyx_t_26 += __pyx_v_outputPoints.shape[0]; + if (__pyx_t_27 < 0) __pyx_t_27 += __pyx_v_outputPoints.shape[1]; + __pyx_v_expArg = (__pyx_v_expArg + ((*((__pyx_t_5numpy_float_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_frequency_grids.data + __pyx_t_19 * __pyx_v_frequency_grids.strides[0]) ) + __pyx_t_25 * __pyx_v_frequency_grids.strides[1]) ))) * (*((__pyx_t_5numpy_float_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_outputPoints.data + __pyx_t_26 * __pyx_v_outputPoints.strides[0]) ) + __pyx_t_27 * __pyx_v_outputPoints.strides[1]) ))))); } /* "fastkde/nufft.pyx":618 @@ -25980,9 +26500,9 @@ static PyArrayObject *__pyx_f_7fastkde_5nufft_dft_points(__Pyx_memviewslice __py * * iDFT[i] = myiDFT */ - __pyx_t_26 = __pyx_v_j; - if (__pyx_t_26 < 0) __pyx_t_26 += __pyx_v_ordinates.shape[0]; - __pyx_v_myiDFT = (__pyx_v_myiDFT + __Pyx_CREAL(__Pyx_c_prod_double((*((__pyx_t_double_complex *) ( /* dim=0 */ (__pyx_v_ordinates.data + __pyx_t_26 * __pyx_v_ordinates.strides[0]) ))), __pyx_f_7fastkde_5nufft_cexp(__Pyx_c_prod_double(__pyx_v_idftConst, __pyx_t_double_complex_from_parts(((double)__pyx_v_expArg), 0)))))); + __pyx_t_25 = __pyx_v_j; + if (__pyx_t_25 < 0) __pyx_t_25 += __pyx_v_ordinates.shape[0]; + __pyx_v_myiDFT = (__pyx_v_myiDFT + __Pyx_CREAL(__Pyx_c_prod_double((*((__pyx_t_double_complex *) ( /* dim=0 */ (__pyx_v_ordinates.data + __pyx_t_25 * __pyx_v_ordinates.strides[0]) ))), __pyx_f_7fastkde_5nufft_cexp(__Pyx_c_prod_double(__pyx_v_idftConst, __pyx_t_double_complex_from_parts(((double)__pyx_v_expArg), 0)))))); } /* "fastkde/nufft.pyx":620 @@ -25992,9 +26512,9 @@ static PyArrayObject *__pyx_f_7fastkde_5nufft_dft_points(__Pyx_memviewslice __py * * return np.array(iDFT,copy=True) */ - __pyx_t_26 = __pyx_v_i; - if (__pyx_t_26 < 0) __pyx_t_26 += __pyx_v_iDFT.shape[0]; - *((__pyx_t_5numpy_float_t *) ( /* dim=0 */ (__pyx_v_iDFT.data + __pyx_t_26 * __pyx_v_iDFT.strides[0]) )) = __pyx_v_myiDFT; + __pyx_t_27 = __pyx_v_i; + if (__pyx_t_27 < 0) __pyx_t_27 += __pyx_v_iDFT.shape[0]; + *((__pyx_t_5numpy_float_t *) ( /* dim=0 */ (__pyx_v_iDFT.data + __pyx_t_27 * __pyx_v_iDFT.strides[0]) )) = __pyx_v_myiDFT; } } @@ -26032,8 +26552,8 @@ static PyArrayObject *__pyx_f_7fastkde_5nufft_dft_points(__Pyx_memviewslice __py __Pyx_XDECREF((PyObject *)__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 622, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_array); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 622, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_array); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 622, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = __pyx_memoryview_fromslice(__pyx_v_iDFT, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float_t, 0);; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 622, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); @@ -26045,9 +26565,9 @@ static PyArrayObject *__pyx_f_7fastkde_5nufft_dft_points(__Pyx_memviewslice __py __pyx_t_8 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 622, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_copy, Py_True) < 0) __PYX_ERR(0, 622, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_3, __pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 622, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_3, __pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 622, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 622, __pyx_L1_error) @@ -26069,10 +26589,10 @@ static PyArrayObject *__pyx_f_7fastkde_5nufft_dft_points(__Pyx_memviewslice __py __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_8); - __PYX_XCLEAR_MEMVIEW(&__pyx_t_10, 1); - __Pyx_XDECREF(__pyx_t_11); - __PYX_XCLEAR_MEMVIEW(&__pyx_t_12, 1); - __PYX_XCLEAR_MEMVIEW(&__pyx_t_21, 1); + __PYX_XCLEAR_MEMVIEW(&__pyx_t_11, 1); + __Pyx_XDECREF(__pyx_t_12); + __PYX_XCLEAR_MEMVIEW(&__pyx_t_13, 1); + __PYX_XCLEAR_MEMVIEW(&__pyx_t_22, 1); __Pyx_AddTraceback("fastkde.nufft.dft_points", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; @@ -26559,6 +27079,9 @@ static PyTypeObject __pyx_type___pyx_array = { #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif + #if PY_VERSION_HEX >= 0x030d00A4 + 0, /*tp_versions_used*/ + #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif @@ -26729,6 +27252,9 @@ static PyTypeObject __pyx_type___pyx_MemviewEnum = { #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif + #if PY_VERSION_HEX >= 0x030d00A4 + 0, /*tp_versions_used*/ + #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif @@ -27072,6 +27598,9 @@ static PyTypeObject __pyx_type___pyx_memoryview = { #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif + #if PY_VERSION_HEX >= 0x030d00A4 + 0, /*tp_versions_used*/ + #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif @@ -27242,6 +27771,9 @@ static PyTypeObject __pyx_type___pyx_memoryviewslice = { #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif + #if PY_VERSION_HEX >= 0x030d00A4 + 0, /*tp_versions_used*/ + #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif @@ -27392,11 +27924,10 @@ static int __Pyx_CreateStringTabAndInitStrings(void) { {&__pyx_n_s_new, __pyx_k_new, sizeof(__pyx_k_new), 0, 0, 1, 1}, {&__pyx_kp_s_no_default___reduce___due_to_non, __pyx_k_no_default___reduce___due_to_non, sizeof(__pyx_k_no_default___reduce___due_to_non), 0, 0, 1, 0}, {&__pyx_n_s_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1}, - {&__pyx_kp_s_nufft_pyx, __pyx_k_nufft_pyx, sizeof(__pyx_k_nufft_pyx), 0, 0, 1, 0}, {&__pyx_n_s_nuifft, __pyx_k_nuifft, sizeof(__pyx_k_nuifft), 0, 0, 1, 1}, {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1}, - {&__pyx_kp_s_numpy_core_multiarray_failed_to, __pyx_k_numpy_core_multiarray_failed_to, sizeof(__pyx_k_numpy_core_multiarray_failed_to), 0, 0, 1, 0}, - {&__pyx_kp_s_numpy_core_umath_failed_to_impor, __pyx_k_numpy_core_umath_failed_to_impor, sizeof(__pyx_k_numpy_core_umath_failed_to_impor), 0, 0, 1, 0}, + {&__pyx_kp_s_numpy__core_multiarray_failed_to, __pyx_k_numpy__core_multiarray_failed_to, sizeof(__pyx_k_numpy__core_multiarray_failed_to), 0, 0, 1, 0}, + {&__pyx_kp_s_numpy__core_umath_failed_to_impo, __pyx_k_numpy__core_umath_failed_to_impo, sizeof(__pyx_k_numpy__core_umath_failed_to_impo), 0, 0, 1, 0}, {&__pyx_n_s_numpy_fft, __pyx_k_numpy_fft, sizeof(__pyx_k_numpy_fft), 0, 0, 1, 1}, {&__pyx_n_s_obj, __pyx_k_obj, sizeof(__pyx_k_obj), 0, 0, 1, 1}, {&__pyx_n_s_ones, __pyx_k_ones, sizeof(__pyx_k_ones), 0, 0, 1, 1}, @@ -27428,6 +27959,7 @@ static int __Pyx_CreateStringTabAndInitStrings(void) { {&__pyx_kp_s_shape_convolvedFFT, __pyx_k_shape_convolvedFFT, sizeof(__pyx_k_shape_convolvedFFT), 0, 0, 1, 0}, {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1}, {&__pyx_n_s_spec, __pyx_k_spec, sizeof(__pyx_k_spec), 0, 0, 1, 1}, + {&__pyx_kp_s_src_fastkde_nufft_pyx, __pyx_k_src_fastkde_nufft_pyx, sizeof(__pyx_k_src_fastkde_nufft_pyx), 0, 0, 1, 0}, {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1}, {&__pyx_n_s_step, __pyx_k_step, sizeof(__pyx_k_step), 0, 0, 1, 1}, {&__pyx_n_s_stop, __pyx_k_stop, sizeof(__pyx_k_stop), 0, 0, 1, 1}, @@ -27463,7 +27995,7 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis); if (!__pyx_builtin_Ellipsis) __PYX_ERR(1, 408, __pyx_L1_error) __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(1, 618, __pyx_L1_error) __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(1, 914, __pyx_L1_error) - __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(2, 983, __pyx_L1_error) + __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(2, 1025, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; @@ -27510,25 +28042,25 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__8); __Pyx_GIVEREF(__pyx_tuple__8); - /* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":983 + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1025 * __pyx_import_array() * except Exception: - * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<< + * raise ImportError("numpy._core.multiarray failed to import") # <<<<<<<<<<<<<< * * cdef inline int import_umath() except -1: */ - __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(2, 983, __pyx_L1_error) + __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_s_numpy__core_multiarray_failed_to); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(2, 1025, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__9); __Pyx_GIVEREF(__pyx_tuple__9); - /* "../../../../mambaforge/envs/fastkde_test/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":989 + /* "../env_312/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1031 * _import_umath() * except Exception: - * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< + * raise ImportError("numpy._core.umath failed to import") # <<<<<<<<<<<<<< * * cdef inline int import_ufunc() except -1: */ - __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(2, 989, __pyx_L1_error) + __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_numpy__core_umath_failed_to_impo); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(2, 1031, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__10); __Pyx_GIVEREF(__pyx_tuple__10); @@ -27577,7 +28109,7 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(__pyx_tuple__15); /* "fastkde/nufft.pyx":129 - * frequencySizes[n] = iNotMissing + * frequencySizes[n] = iNotMissing * else: * raise ValueError("Some frequencies in frequency_grids have no valid points") # <<<<<<<<<<<<<< * @@ -27742,7 +28274,7 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __pyx_tuple__34 = PyTuple_Pack(6, __pyx_n_s_abscissas, __pyx_n_s_ordinates, __pyx_n_s_frequency_grids, __pyx_n_s_missing_freq_val, __pyx_n_s_precision, __pyx_n_s_be_verbose); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(0, 30, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__34); __Pyx_GIVEREF(__pyx_tuple__34); - __pyx_codeobj__35 = (PyObject*)__Pyx_PyCode_New(6, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__34, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_nufft_pyx, __pyx_n_s_nuifft, 30, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__35)) __PYX_ERR(0, 30, __pyx_L1_error) + __pyx_codeobj__35 = (PyObject*)__Pyx_PyCode_New(6, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__34, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_fastkde_nufft_pyx, __pyx_n_s_nuifft, 30, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__35)) __PYX_ERR(0, 30, __pyx_L1_error) /* "fastkde/nufft.pyx":276 * #******************************************************************************* @@ -27754,7 +28286,7 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __pyx_tuple__36 = PyTuple_Pack(5, __pyx_n_s_abscissas, __pyx_n_s_ordinates, __pyx_n_s_frequency_grids, __pyx_n_s_missing_freq_val, __pyx_n_s_be_verbose); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(0, 276, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__36); __Pyx_GIVEREF(__pyx_tuple__36); - __pyx_codeobj__37 = (PyObject*)__Pyx_PyCode_New(5, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__36, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_nufft_pyx, __pyx_n_s_idft, 276, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__37)) __PYX_ERR(0, 276, __pyx_L1_error) + __pyx_codeobj__37 = (PyObject*)__Pyx_PyCode_New(5, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__36, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_fastkde_nufft_pyx, __pyx_n_s_idft, 276, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__37)) __PYX_ERR(0, 276, __pyx_L1_error) /* "fastkde/nufft.pyx":468 * #***************************************************************************** @@ -27766,7 +28298,7 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __pyx_tuple__38 = PyTuple_Pack(2, __pyx_n_s_tpoints, __pyx_n_s_deltaT); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(0, 468, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__38); __Pyx_GIVEREF(__pyx_tuple__38); - __pyx_codeobj__39 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__38, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_nufft_pyx, __pyx_n_s_calc_x_from_t, 468, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__39)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_codeobj__39 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__38, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_fastkde_nufft_pyx, __pyx_n_s_calc_x_from_t, 468, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__39)) __PYX_ERR(0, 468, __pyx_L1_error) /* "fastkde/nufft.pyx":475 * return fft.fftshift(fft.fftfreq(len(tpoints),deltaT/(2*np.pi))) @@ -27778,7 +28310,7 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __pyx_tuple__40 = PyTuple_Pack(2, __pyx_n_s_xpoints, __pyx_n_s_deltaX); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(0, 475, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__40); __Pyx_GIVEREF(__pyx_tuple__40); - __pyx_codeobj__41 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_nufft_pyx, __pyx_n_s_calc_t_from_x, 475, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__41)) __PYX_ERR(0, 475, __pyx_L1_error) + __pyx_codeobj__41 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_fastkde_nufft_pyx, __pyx_n_s_calc_t_from_x, 475, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__41)) __PYX_ERR(0, 475, __pyx_L1_error) /* "fastkde/nufft.pyx":482 * return fft.fftshift(fft.fftfreq(len(xpoints),deltaX/(2*np.pi))) @@ -27790,7 +28322,7 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __pyx_tuple__42 = PyTuple_Pack(2, __pyx_n_s_msg, __pyx_n_s_be_verbose); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(0, 482, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__42); __Pyx_GIVEREF(__pyx_tuple__42); - __pyx_codeobj__43 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__42, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_nufft_pyx, __pyx_n_s_vprint, 482, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__43)) __PYX_ERR(0, 482, __pyx_L1_error) + __pyx_codeobj__43 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__42, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_fastkde_nufft_pyx, __pyx_n_s_vprint, 482, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__43)) __PYX_ERR(0, 482, __pyx_L1_error) /* "fastkde/nufft.pyx":494 * #******************************************************************************* @@ -27802,7 +28334,7 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __pyx_tuple__44 = PyTuple_Pack(5, __pyx_n_s_frequency_grids, __pyx_n_s_ordinates, __pyx_n_s_outputPoints, __pyx_n_s_missing_freq_val, __pyx_n_s_be_verbose); if (unlikely(!__pyx_tuple__44)) __PYX_ERR(0, 494, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__44); __Pyx_GIVEREF(__pyx_tuple__44); - __pyx_codeobj__45 = (PyObject*)__Pyx_PyCode_New(5, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__44, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_nufft_pyx, __pyx_n_s_dft_points, 494, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__45)) __PYX_ERR(0, 494, __pyx_L1_error) + __pyx_codeobj__45 = (PyObject*)__Pyx_PyCode_New(5, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__44, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_fastkde_nufft_pyx, __pyx_n_s_dft_points, 494, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__45)) __PYX_ERR(0, 494, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; @@ -27850,6 +28382,13 @@ if (unlikely(_import_array() == -1)) { #endif #endif +if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error) + + /* InitThreads.init */ + #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 +PyEval_InitThreads(); +#endif + if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error) return 0; @@ -28062,33 +28601,33 @@ static int __Pyx_modinit_type_import_code(void) { /*--- Type import code ---*/ __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_ptype_7cpython_4type_type = __Pyx_ImportType_3_0_3(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type", + __pyx_ptype_7cpython_4type_type = __Pyx_ImportType_3_0_11(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type", #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000 - sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_3(PyTypeObject), + sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyTypeObject), #elif CYTHON_COMPILING_IN_LIMITED_API - sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_3(PyTypeObject), + sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyTypeObject), #else - sizeof(PyHeapTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_3(PyHeapTypeObject), + sizeof(PyHeapTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyHeapTypeObject), #endif - __Pyx_ImportType_CheckSize_Warn_3_0_3); if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(3, 9, __pyx_L1_error) + __Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(3, 9, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyImport_ImportModule("numpy"); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 202, __pyx_L1_error) + __pyx_t_1 = PyImport_ImportModule("numpy"); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 271, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_ptype_5numpy_dtype = __Pyx_ImportType_3_0_3(__pyx_t_1, "numpy", "dtype", sizeof(PyArray_Descr), __PYX_GET_STRUCT_ALIGNMENT_3_0_3(PyArray_Descr),__Pyx_ImportType_CheckSize_Ignore_3_0_3); if (!__pyx_ptype_5numpy_dtype) __PYX_ERR(2, 202, __pyx_L1_error) - __pyx_ptype_5numpy_flatiter = __Pyx_ImportType_3_0_3(__pyx_t_1, "numpy", "flatiter", sizeof(PyArrayIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_3(PyArrayIterObject),__Pyx_ImportType_CheckSize_Ignore_3_0_3); if (!__pyx_ptype_5numpy_flatiter) __PYX_ERR(2, 225, __pyx_L1_error) - __pyx_ptype_5numpy_broadcast = __Pyx_ImportType_3_0_3(__pyx_t_1, "numpy", "broadcast", sizeof(PyArrayMultiIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_3(PyArrayMultiIterObject),__Pyx_ImportType_CheckSize_Ignore_3_0_3); if (!__pyx_ptype_5numpy_broadcast) __PYX_ERR(2, 229, __pyx_L1_error) - __pyx_ptype_5numpy_ndarray = __Pyx_ImportType_3_0_3(__pyx_t_1, "numpy", "ndarray", sizeof(PyArrayObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_3(PyArrayObject),__Pyx_ImportType_CheckSize_Ignore_3_0_3); if (!__pyx_ptype_5numpy_ndarray) __PYX_ERR(2, 238, __pyx_L1_error) - __pyx_ptype_5numpy_generic = __Pyx_ImportType_3_0_3(__pyx_t_1, "numpy", "generic", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_3(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_3); if (!__pyx_ptype_5numpy_generic) __PYX_ERR(2, 809, __pyx_L1_error) - __pyx_ptype_5numpy_number = __Pyx_ImportType_3_0_3(__pyx_t_1, "numpy", "number", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_3(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_3); if (!__pyx_ptype_5numpy_number) __PYX_ERR(2, 811, __pyx_L1_error) - __pyx_ptype_5numpy_integer = __Pyx_ImportType_3_0_3(__pyx_t_1, "numpy", "integer", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_3(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_3); if (!__pyx_ptype_5numpy_integer) __PYX_ERR(2, 813, __pyx_L1_error) - __pyx_ptype_5numpy_signedinteger = __Pyx_ImportType_3_0_3(__pyx_t_1, "numpy", "signedinteger", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_3(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_3); if (!__pyx_ptype_5numpy_signedinteger) __PYX_ERR(2, 815, __pyx_L1_error) - __pyx_ptype_5numpy_unsignedinteger = __Pyx_ImportType_3_0_3(__pyx_t_1, "numpy", "unsignedinteger", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_3(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_3); if (!__pyx_ptype_5numpy_unsignedinteger) __PYX_ERR(2, 817, __pyx_L1_error) - __pyx_ptype_5numpy_inexact = __Pyx_ImportType_3_0_3(__pyx_t_1, "numpy", "inexact", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_3(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_3); if (!__pyx_ptype_5numpy_inexact) __PYX_ERR(2, 819, __pyx_L1_error) - __pyx_ptype_5numpy_floating = __Pyx_ImportType_3_0_3(__pyx_t_1, "numpy", "floating", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_3(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_3); if (!__pyx_ptype_5numpy_floating) __PYX_ERR(2, 821, __pyx_L1_error) - __pyx_ptype_5numpy_complexfloating = __Pyx_ImportType_3_0_3(__pyx_t_1, "numpy", "complexfloating", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_3(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_3); if (!__pyx_ptype_5numpy_complexfloating) __PYX_ERR(2, 823, __pyx_L1_error) - __pyx_ptype_5numpy_flexible = __Pyx_ImportType_3_0_3(__pyx_t_1, "numpy", "flexible", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_3(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_3); if (!__pyx_ptype_5numpy_flexible) __PYX_ERR(2, 825, __pyx_L1_error) - __pyx_ptype_5numpy_character = __Pyx_ImportType_3_0_3(__pyx_t_1, "numpy", "character", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_3(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_3); if (!__pyx_ptype_5numpy_character) __PYX_ERR(2, 827, __pyx_L1_error) - __pyx_ptype_5numpy_ufunc = __Pyx_ImportType_3_0_3(__pyx_t_1, "numpy", "ufunc", sizeof(PyUFuncObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_3(PyUFuncObject),__Pyx_ImportType_CheckSize_Ignore_3_0_3); if (!__pyx_ptype_5numpy_ufunc) __PYX_ERR(2, 865, __pyx_L1_error) + __pyx_ptype_5numpy_dtype = __Pyx_ImportType_3_0_11(__pyx_t_1, "numpy", "dtype", sizeof(PyArray_Descr), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyArray_Descr),__Pyx_ImportType_CheckSize_Ignore_3_0_11); if (!__pyx_ptype_5numpy_dtype) __PYX_ERR(2, 271, __pyx_L1_error) + __pyx_ptype_5numpy_flatiter = __Pyx_ImportType_3_0_11(__pyx_t_1, "numpy", "flatiter", sizeof(PyArrayIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyArrayIterObject),__Pyx_ImportType_CheckSize_Ignore_3_0_11); if (!__pyx_ptype_5numpy_flatiter) __PYX_ERR(2, 316, __pyx_L1_error) + __pyx_ptype_5numpy_broadcast = __Pyx_ImportType_3_0_11(__pyx_t_1, "numpy", "broadcast", sizeof(PyArrayMultiIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyArrayMultiIterObject),__Pyx_ImportType_CheckSize_Ignore_3_0_11); if (!__pyx_ptype_5numpy_broadcast) __PYX_ERR(2, 320, __pyx_L1_error) + __pyx_ptype_5numpy_ndarray = __Pyx_ImportType_3_0_11(__pyx_t_1, "numpy", "ndarray", sizeof(PyArrayObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyArrayObject),__Pyx_ImportType_CheckSize_Ignore_3_0_11); if (!__pyx_ptype_5numpy_ndarray) __PYX_ERR(2, 359, __pyx_L1_error) + __pyx_ptype_5numpy_generic = __Pyx_ImportType_3_0_11(__pyx_t_1, "numpy", "generic", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5numpy_generic) __PYX_ERR(2, 847, __pyx_L1_error) + __pyx_ptype_5numpy_number = __Pyx_ImportType_3_0_11(__pyx_t_1, "numpy", "number", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5numpy_number) __PYX_ERR(2, 849, __pyx_L1_error) + __pyx_ptype_5numpy_integer = __Pyx_ImportType_3_0_11(__pyx_t_1, "numpy", "integer", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5numpy_integer) __PYX_ERR(2, 851, __pyx_L1_error) + __pyx_ptype_5numpy_signedinteger = __Pyx_ImportType_3_0_11(__pyx_t_1, "numpy", "signedinteger", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5numpy_signedinteger) __PYX_ERR(2, 853, __pyx_L1_error) + __pyx_ptype_5numpy_unsignedinteger = __Pyx_ImportType_3_0_11(__pyx_t_1, "numpy", "unsignedinteger", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5numpy_unsignedinteger) __PYX_ERR(2, 855, __pyx_L1_error) + __pyx_ptype_5numpy_inexact = __Pyx_ImportType_3_0_11(__pyx_t_1, "numpy", "inexact", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5numpy_inexact) __PYX_ERR(2, 857, __pyx_L1_error) + __pyx_ptype_5numpy_floating = __Pyx_ImportType_3_0_11(__pyx_t_1, "numpy", "floating", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5numpy_floating) __PYX_ERR(2, 859, __pyx_L1_error) + __pyx_ptype_5numpy_complexfloating = __Pyx_ImportType_3_0_11(__pyx_t_1, "numpy", "complexfloating", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5numpy_complexfloating) __PYX_ERR(2, 861, __pyx_L1_error) + __pyx_ptype_5numpy_flexible = __Pyx_ImportType_3_0_11(__pyx_t_1, "numpy", "flexible", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5numpy_flexible) __PYX_ERR(2, 863, __pyx_L1_error) + __pyx_ptype_5numpy_character = __Pyx_ImportType_3_0_11(__pyx_t_1, "numpy", "character", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5numpy_character) __PYX_ERR(2, 865, __pyx_L1_error) + __pyx_ptype_5numpy_ufunc = __Pyx_ImportType_3_0_11(__pyx_t_1, "numpy", "ufunc", sizeof(PyUFuncObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyUFuncObject),__Pyx_ImportType_CheckSize_Ignore_3_0_11); if (!__pyx_ptype_5numpy_ufunc) __PYX_ERR(2, 929, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_RefNannyFinishContext(); return 0; @@ -28308,7 +28847,7 @@ static CYTHON_SMALL_CODE int __pyx_pymod_exec_nufft(PyObject *__pyx_pyinit_modul __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) { int add_module_result = PyState_AddModule(__pyx_t_1, &__pyx_moduledef); - __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to nufft pseudovariable */ + __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to "nufft" pseudovariable */ if (unlikely((add_module_result < 0))) __PYX_ERR(0, 1, __pyx_L1_error) pystate_addmodule_run = 1; } @@ -28320,10 +28859,8 @@ static CYTHON_SMALL_CODE int __pyx_pymod_exec_nufft(PyObject *__pyx_pyinit_modul CYTHON_UNUSED_VAR(__pyx_t_1); __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) Py_INCREF(__pyx_d); - __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) - Py_INCREF(__pyx_b); - __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) - Py_INCREF(__pyx_cython_runtime); + __pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_cython_runtime = __Pyx_PyImport_AddModuleRef((const char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #if CYTHON_REFNANNY __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); @@ -29304,14 +29841,20 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject #endif /* PyObjectGetAttrStrNoError */ +#if __PYX_LIMITED_VERSION_HEX < 0x030d00A1 static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) __Pyx_PyErr_Clear(); } +#endif static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) { PyObject *result; +#if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 + (void) PyObject_GetOptionalAttr(obj, attr_name, &result); + return result; +#else #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1 PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) { @@ -29323,6 +29866,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, P __Pyx_PyObject_GetAttrStr_ClearAttributeError(); } return result; +#endif } /* GetBuiltinName */ @@ -29538,13 +30082,31 @@ static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyO { int eq = __Pyx_PyUnicode_Equals(s, PyTuple_GET_ITEM(kwnames, i), Py_EQ); if (unlikely(eq != 0)) { - if (unlikely(eq < 0)) return NULL; // error + if (unlikely(eq < 0)) return NULL; return kwvalues[i]; } } - return NULL; // not found (no exception set) + return NULL; +} +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 +CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues) { + Py_ssize_t i, nkwargs = PyTuple_GET_SIZE(kwnames); + PyObject *dict; + dict = PyDict_New(); + if (unlikely(!dict)) + return NULL; + for (i=0; i= 3 co->co_kwonlyargcount == 0 && @@ -30054,8 +30622,13 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg ternaryfunc call = Py_TYPE(func)->tp_call; if (unlikely(!call)) return PyObject_Call(func, arg, kw); + #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; + #else + if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) + return NULL; + #endif result = (*call)(func, arg, kw); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { @@ -30074,8 +30647,13 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject PyCFunction cfunc; cfunc = __Pyx_CyOrPyCFunction_GET_FUNCTION(func); self = __Pyx_CyOrPyCFunction_GET_SELF(func); + #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; + #else + if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) + return NULL; + #endif result = cfunc(self, arg); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { @@ -30140,7 +30718,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObj #endif if (kwargs == NULL) { #if CYTHON_VECTORCALL - #if Py_VERSION_HEX < 0x03090000 + #if PY_VERSION_HEX < 0x03090000 vectorcallfunc f = _PyVectorcall_Function(func); #else vectorcallfunc f = PyVectorcall_Function(func); @@ -30465,7 +31043,7 @@ static PyObject* __Pyx_PyUnicode_Join(PyObject* value_tuple, Py_ssize_t value_co if (!CYTHON_PEP393_ENABLED || ukind == result_ukind) { memcpy((char *)result_udata + (char_pos << kind_shift), udata, (size_t) (ulength << kind_shift)); } else { - #if PY_VERSION_HEX >= 0x030D0000 + #if PY_VERSION_HEX >= 0x030d0000 if (unlikely(PyUnicode_CopyCharacters(result_uval, char_pos, uval, 0, ulength) < 0)) goto bad; #elif CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030300F0 || defined(_PyUnicode_FastCopyCharacters) _PyUnicode_FastCopyCharacters(result_uval, char_pos, uval, 0, ulength); @@ -30594,7 +31172,7 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, } } #else - if (is_list || PySequence_Check(o)) { + if (is_list || !PyMapping_Check(o)) { return PySequence_GetItem(o, i); } #endif @@ -30629,7 +31207,9 @@ static PyObject *__Pyx_PyObject_GetItem_Slow(PyObject *obj, PyObject *key) { __Pyx_TypeName obj_type_name; if (likely(PyType_Check(obj))) { PyObject *meth = __Pyx_PyObject_GetAttrStrNoError(obj, __pyx_n_s_class_getitem); - if (meth) { + if (!meth) { + PyErr_Clear(); + } else { PyObject *result = __Pyx_PyObject_CallOneArg(meth, key); Py_DECREF(meth); return result; @@ -30738,6 +31318,7 @@ static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t a, Py_ssize_t b) } /* GetAttr3 */ +#if __PYX_LIMITED_VERSION_HEX < 0x030d00A1 static PyObject *__Pyx_GetAttr3Default(PyObject *d) { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign @@ -30747,9 +31328,14 @@ static PyObject *__Pyx_GetAttr3Default(PyObject *d) { Py_INCREF(d); return d; } +#endif static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) { PyObject *r; -#if CYTHON_USE_TYPE_SLOTS +#if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 + int res = PyObject_GetOptionalAttr(o, n, &r); + return (res != 0) ? r : __Pyx_NewRef(d); +#else + #if CYTHON_USE_TYPE_SLOTS if (likely(PyString_Check(n))) { r = __Pyx_PyObject_GetAttrStrNoError(o, n); if (unlikely(!r) && likely(!PyErr_Occurred())) { @@ -30757,9 +31343,10 @@ static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject } return r; } -#endif + #endif r = PyObject_GetAttr(o, n); return (likely(r)) ? r : __Pyx_GetAttr3Default(d); +#endif } /* PyDictVersioning */ @@ -30797,7 +31384,7 @@ static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) { PyObject *result; #if !CYTHON_AVOID_BORROWED_REFS -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && PY_VERSION_HEX < 0x030d0000 result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { @@ -31469,11 +32056,7 @@ static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObje } } #else -#if CYTHON_COMPILING_IN_PYPY - if (is_list || (PySequence_Check(o) && !PyDict_Check(o))) -#else - if (is_list || PySequence_Check(o)) -#endif + if (is_list || !PyMapping_Check(o)) { return PySequence_SetItem(o, i, v); } @@ -31568,10 +32151,10 @@ static CYTHON_INLINE int __Pyx_ErrOccurredWithGIL(void) { return err; } -/* DivInt[__pyx_t_5numpy_int_t] */ -static CYTHON_INLINE __pyx_t_5numpy_int_t __Pyx_div___pyx_t_5numpy_int_t(__pyx_t_5numpy_int_t a, __pyx_t_5numpy_int_t b) { - __pyx_t_5numpy_int_t q = a / b; - __pyx_t_5numpy_int_t r = a - q*b; +/* DivInt[__pyx_t_5numpy_int64_t] */ +static CYTHON_INLINE __pyx_t_5numpy_int64_t __Pyx_div___pyx_t_5numpy_int64_t(__pyx_t_5numpy_int64_t a, __pyx_t_5numpy_int64_t b) { + __pyx_t_5numpy_int64_t q = a / b; + __pyx_t_5numpy_int64_t r = a - q*b; q -= ((r != 0) & ((r ^ b) < 0)); return q; } @@ -32016,38 +32599,38 @@ static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffs #endif return -1; } -#if !CYTHON_USE_TYPE_SLOTS - if (dictoffset == 0) { - PyErr_Format(PyExc_TypeError, - "extension type '%s.200s': " - "unable to validate whether bases have a __dict__ " - "when CYTHON_USE_TYPE_SLOTS is off " - "(likely because you are building in the limited API). " - "Therefore, all extension types with multiple bases " - "must add 'cdef dict __dict__' in this compilation mode", - type_name); -#if CYTHON_AVOID_BORROWED_REFS - Py_DECREF(b0); -#endif - return -1; - } -#else - if (dictoffset == 0 && b->tp_dictoffset) + if (dictoffset == 0) { - __Pyx_TypeName b_name = __Pyx_PyType_GetName(b); - PyErr_Format(PyExc_TypeError, - "extension type '%.200s' has no __dict__ slot, " - "but base type '" __Pyx_FMT_TYPENAME "' has: " - "either add 'cdef dict __dict__' to the extension type " - "or add '__slots__ = [...]' to the base type", - type_name, b_name); - __Pyx_DECREF_TypeName(b_name); + Py_ssize_t b_dictoffset = 0; +#if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY + b_dictoffset = b->tp_dictoffset; +#else + PyObject *py_b_dictoffset = PyObject_GetAttrString((PyObject*)b, "__dictoffset__"); + if (!py_b_dictoffset) goto dictoffset_return; + b_dictoffset = PyLong_AsSsize_t(py_b_dictoffset); + Py_DECREF(py_b_dictoffset); + if (b_dictoffset == -1 && PyErr_Occurred()) goto dictoffset_return; +#endif + if (b_dictoffset) { + { + __Pyx_TypeName b_name = __Pyx_PyType_GetName(b); + PyErr_Format(PyExc_TypeError, + "extension type '%.200s' has no __dict__ slot, " + "but base type '" __Pyx_FMT_TYPENAME "' has: " + "either add 'cdef dict __dict__' to the extension type " + "or add '__slots__ = [...]' to the base type", + type_name, b_name); + __Pyx_DECREF_TypeName(b_name); + } +#if !(CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY) + dictoffset_return: +#endif #if CYTHON_AVOID_BORROWED_REFS - Py_DECREF(b0); + Py_DECREF(b0); #endif - return -1; + return -1; + } } -#endif #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(b0); #endif @@ -32341,10 +32924,10 @@ static int __Pyx_setup_reduce(PyObject* type_obj) { #endif /* TypeImport */ -#ifndef __PYX_HAVE_RT_ImportType_3_0_3 -#define __PYX_HAVE_RT_ImportType_3_0_3 -static PyTypeObject *__Pyx_ImportType_3_0_3(PyObject *module, const char *module_name, const char *class_name, - size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_3 check_size) +#ifndef __PYX_HAVE_RT_ImportType_3_0_11 +#define __PYX_HAVE_RT_ImportType_3_0_11 +static PyTypeObject *__Pyx_ImportType_3_0_11(PyObject *module, const char *module_name, const char *class_name, + size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_11 check_size) { PyObject *result = 0; char warning[200]; @@ -32398,7 +32981,7 @@ static PyTypeObject *__Pyx_ImportType_3_0_3(PyObject *module, const char *module module_name, class_name, size, basicsize+itemsize); goto bad; } - if (check_size == __Pyx_ImportType_CheckSize_Error_3_0_3 && + if (check_size == __Pyx_ImportType_CheckSize_Error_3_0_11 && ((size_t)basicsize > size || (size_t)(basicsize + itemsize) < size)) { PyErr_Format(PyExc_ValueError, "%.200s.%.200s size changed, may indicate binary incompatibility. " @@ -32406,7 +32989,7 @@ static PyTypeObject *__Pyx_ImportType_3_0_3(PyObject *module, const char *module module_name, class_name, size, basicsize, basicsize+itemsize); goto bad; } - else if (check_size == __Pyx_ImportType_CheckSize_Warn_3_0_3 && (size_t)basicsize > size) { + else if (check_size == __Pyx_ImportType_CheckSize_Warn_3_0_11 && (size_t)basicsize > size) { PyOS_snprintf(warning, sizeof(warning), "%s.%s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd from PyObject", @@ -32450,10 +33033,7 @@ static PyObject *__Pyx_ImportDottedModuleRelFirst(PyObject *name, PyObject *part /* FetchSharedCythonModule */ static PyObject *__Pyx_FetchSharedCythonABIModule(void) { - PyObject *abi_module = PyImport_AddModule((char*) __PYX_ABI_MODULE_NAME); - if (unlikely(!abi_module)) return NULL; - Py_INCREF(abi_module); - return abi_module; + return __Pyx_PyImport_AddModuleRef((char*) __PYX_ABI_MODULE_NAME); } /* FetchCommonType */ @@ -33437,7 +34017,7 @@ static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, default: return NULL; } - return ((_PyCFunctionFastWithKeywords)(void(*)(void))def->ml_meth)(self, args, nargs, kwnames); + return ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))def->ml_meth)(self, args, nargs, kwnames); } static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { @@ -33572,6 +34152,9 @@ static PyTypeObject __pyx_CyFunctionType_type = { #if PY_VERSION_HEX >= 0x030C0000 0, #endif +#if PY_VERSION_HEX >= 0x030d00A4 + 0, +#endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, #endif @@ -33776,8 +34359,8 @@ static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject Py_DECREF(replace); return result; } - #if __PYX_LIMITED_VERSION_HEX < 0x030780000 PyErr_Clear(); + #if __PYX_LIMITED_VERSION_HEX < 0x030780000 { PyObject *compiled = NULL, *result = NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "code", code))) return NULL; @@ -33797,6 +34380,8 @@ static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject if (result) Py_INCREF(result); return result; } + #else + return NULL; #endif } static void __Pyx_AddTraceback(const char *funcname, int c_line, @@ -33894,7 +34479,7 @@ static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( #else py_code = PyCode_NewEmpty(filename, funcname, py_line); #endif - Py_XDECREF(py_funcname); // XDECREF since it's only set on Py3 if cline + Py_XDECREF(py_funcname); return py_code; bad: Py_XDECREF(py_funcname); @@ -35033,7 +35618,7 @@ static CYTHON_INLINE int __pyx_memview_set___pyx_t_double_complex(const char *it } /* ObjectToMemviewSlice */ - static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int_t(PyObject *obj, int writable_flag) { + static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(PyObject *obj, int writable_flag) { __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } }; __Pyx_BufFmt_StackElem stack[1]; int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) }; @@ -35044,7 +35629,7 @@ static CYTHON_INLINE int __pyx_memview_set___pyx_t_double_complex(const char *it } retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0, PyBUF_RECORDS_RO | writable_flag, 1, - &__Pyx_TypeInfo_nn___pyx_t_5numpy_int_t, stack, + &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, stack, &result, obj); if (unlikely(retcode == -1)) goto __pyx_fail; @@ -35056,14 +35641,14 @@ static CYTHON_INLINE int __pyx_memview_set___pyx_t_double_complex(const char *it } /* MemviewDtypeToObject */ - static CYTHON_INLINE PyObject *__pyx_memview_get_nn___pyx_t_5numpy_int_t(const char *itemp) { - return (PyObject *) __Pyx_PyInt_From_npy_long(*(__pyx_t_5numpy_int_t *) itemp); + static CYTHON_INLINE PyObject *__pyx_memview_get_nn___pyx_t_5numpy_int64_t(const char *itemp) { + return (PyObject *) __Pyx_PyInt_From_npy_int64(*(__pyx_t_5numpy_int64_t *) itemp); } -static CYTHON_INLINE int __pyx_memview_set_nn___pyx_t_5numpy_int_t(const char *itemp, PyObject *obj) { - __pyx_t_5numpy_int_t value = __Pyx_PyInt_As_npy_long(obj); - if (unlikely((value == ((npy_long)-1)) && PyErr_Occurred())) +static CYTHON_INLINE int __pyx_memview_set_nn___pyx_t_5numpy_int64_t(const char *itemp, PyObject *obj) { + __pyx_t_5numpy_int64_t value = __Pyx_PyInt_As_npy_int64(obj); + if (unlikely((value == ((npy_int64)-1)) && PyErr_Occurred())) return 0; - *(__pyx_t_5numpy_int_t *) itemp = value; + *(__pyx_t_5numpy_int64_t *) itemp = value; return 1; } @@ -35377,6 +35962,160 @@ static int __Pyx_Print(PyObject* stream, PyObject *arg_tuple, int newline) { #endif #endif +/* Declarations */ + #if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus) + #ifdef __cplusplus + static CYTHON_INLINE __pyx_t_long_double_complex __pyx_t_long_double_complex_from_parts(long double x, long double y) { + return ::std::complex< long double >(x, y); + } + #else + static CYTHON_INLINE __pyx_t_long_double_complex __pyx_t_long_double_complex_from_parts(long double x, long double y) { + return x + y*(__pyx_t_long_double_complex)_Complex_I; + } + #endif +#else + static CYTHON_INLINE __pyx_t_long_double_complex __pyx_t_long_double_complex_from_parts(long double x, long double y) { + __pyx_t_long_double_complex z; + z.real = x; + z.imag = y; + return z; + } +#endif + +/* Arithmetic */ + #if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus) +#else + static CYTHON_INLINE int __Pyx_c_eq_long__double(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) { + return (a.real == b.real) && (a.imag == b.imag); + } + static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_sum_long__double(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) { + __pyx_t_long_double_complex z; + z.real = a.real + b.real; + z.imag = a.imag + b.imag; + return z; + } + static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_diff_long__double(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) { + __pyx_t_long_double_complex z; + z.real = a.real - b.real; + z.imag = a.imag - b.imag; + return z; + } + static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_prod_long__double(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) { + __pyx_t_long_double_complex z; + z.real = a.real * b.real - a.imag * b.imag; + z.imag = a.real * b.imag + a.imag * b.real; + return z; + } + #if 1 + static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_quot_long__double(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) { + if (b.imag == 0) { + return __pyx_t_long_double_complex_from_parts(a.real / b.real, a.imag / b.real); + } else if (fabsl(b.real) >= fabsl(b.imag)) { + if (b.real == 0 && b.imag == 0) { + return __pyx_t_long_double_complex_from_parts(a.real / b.real, a.imag / b.imag); + } else { + long double r = b.imag / b.real; + long double s = (long double)(1.0) / (b.real + b.imag * r); + return __pyx_t_long_double_complex_from_parts( + (a.real + a.imag * r) * s, (a.imag - a.real * r) * s); + } + } else { + long double r = b.real / b.imag; + long double s = (long double)(1.0) / (b.imag + b.real * r); + return __pyx_t_long_double_complex_from_parts( + (a.real * r + a.imag) * s, (a.imag * r - a.real) * s); + } + } + #else + static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_quot_long__double(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) { + if (b.imag == 0) { + return __pyx_t_long_double_complex_from_parts(a.real / b.real, a.imag / b.real); + } else { + long double denom = b.real * b.real + b.imag * b.imag; + return __pyx_t_long_double_complex_from_parts( + (a.real * b.real + a.imag * b.imag) / denom, + (a.imag * b.real - a.real * b.imag) / denom); + } + } + #endif + static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_neg_long__double(__pyx_t_long_double_complex a) { + __pyx_t_long_double_complex z; + z.real = -a.real; + z.imag = -a.imag; + return z; + } + static CYTHON_INLINE int __Pyx_c_is_zero_long__double(__pyx_t_long_double_complex a) { + return (a.real == 0) && (a.imag == 0); + } + static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_conj_long__double(__pyx_t_long_double_complex a) { + __pyx_t_long_double_complex z; + z.real = a.real; + z.imag = -a.imag; + return z; + } + #if 1 + static CYTHON_INLINE long double __Pyx_c_abs_long__double(__pyx_t_long_double_complex z) { + #if !defined(HAVE_HYPOT) || defined(_MSC_VER) + return sqrtl(z.real*z.real + z.imag*z.imag); + #else + return hypotl(z.real, z.imag); + #endif + } + static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_pow_long__double(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) { + __pyx_t_long_double_complex z; + long double r, lnr, theta, z_r, z_theta; + if (b.imag == 0 && b.real == (int)b.real) { + if (b.real < 0) { + long double denom = a.real * a.real + a.imag * a.imag; + a.real = a.real / denom; + a.imag = -a.imag / denom; + b.real = -b.real; + } + switch ((int)b.real) { + case 0: + z.real = 1; + z.imag = 0; + return z; + case 1: + return a; + case 2: + return __Pyx_c_prod_long__double(a, a); + case 3: + z = __Pyx_c_prod_long__double(a, a); + return __Pyx_c_prod_long__double(z, a); + case 4: + z = __Pyx_c_prod_long__double(a, a); + return __Pyx_c_prod_long__double(z, z); + } + } + if (a.imag == 0) { + if (a.real == 0) { + return a; + } else if ((b.imag == 0) && (a.real >= 0)) { + z.real = powl(a.real, b.real); + z.imag = 0; + return z; + } else if (a.real > 0) { + r = a.real; + theta = 0; + } else { + r = -a.real; + theta = atan2l(0.0, -1.0); + } + } else { + r = __Pyx_c_abs_long__double(a); + theta = atan2l(a.imag, a.real); + } + lnr = logl(r); + z_r = expl(lnr * b.real - theta * b.imag); + z_theta = theta * b.real + lnr * b.imag; + z.real = z_r * cosl(z_theta); + z.imag = z_r * sinl(z_theta); + return z; + } + #endif +#endif + /* MemviewSliceCopyTemplate */ static __Pyx_memviewslice __pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs, @@ -35601,245 +36340,239 @@ static CYTHON_INLINE void __Pyx_XCLEAR_MEMVIEW(__Pyx_memviewslice *memslice, } return (int) val; } - } else + } #endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { + if (unlikely(!PyLong_Check(x))) { + int val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (int) -1; + val = __Pyx_PyInt_As_int(tmp); + Py_DECREF(tmp); + return val; + } + if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS - if (unlikely(__Pyx_PyLong_IsNeg(x))) { - goto raise_neg_overflow; - } else if (__Pyx_PyLong_IsCompact(x)) { - __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) - } else { - const digit* digits = __Pyx_PyLong_Digits(x); - assert(__Pyx_PyLong_DigitCount(x) > 1); - switch (__Pyx_PyLong_DigitCount(x)) { - case 2: - if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(int) >= 2 * PyLong_SHIFT)) { - return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); - } + if (unlikely(__Pyx_PyLong_IsNeg(x))) { + goto raise_neg_overflow; + } else if (__Pyx_PyLong_IsCompact(x)) { + __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) + } else { + const digit* digits = __Pyx_PyLong_Digits(x); + assert(__Pyx_PyLong_DigitCount(x) > 1); + switch (__Pyx_PyLong_DigitCount(x)) { + case 2: + if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) >= 2 * PyLong_SHIFT)) { + return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } - break; - case 3: - if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(int) >= 3 * PyLong_SHIFT)) { - return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); - } + } + break; + case 3: + if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) >= 3 * PyLong_SHIFT)) { + return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } - break; - case 4: - if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(int) >= 4 * PyLong_SHIFT)) { - return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); - } + } + break; + case 4: + if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) >= 4 * PyLong_SHIFT)) { + return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } - break; - } + } + break; } + } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 - if (unlikely(Py_SIZE(x) < 0)) { - goto raise_neg_overflow; - } + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } #else - { - int result = PyObject_RichCompareBool(x, Py_False, Py_LT); - if (unlikely(result < 0)) - return (int) -1; - if (unlikely(result == 1)) - goto raise_neg_overflow; - } + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (int) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } #endif - if ((sizeof(int) <= sizeof(unsigned long))) { - __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) + if ((sizeof(int) <= sizeof(unsigned long))) { + __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG - } else if ((sizeof(int) <= sizeof(unsigned PY_LONG_LONG))) { - __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) + } else if ((sizeof(int) <= sizeof(unsigned PY_LONG_LONG))) { + __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif - } - } else { + } + } else { #if CYTHON_USE_PYLONG_INTERNALS - if (__Pyx_PyLong_IsCompact(x)) { - __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) - } else { - const digit* digits = __Pyx_PyLong_Digits(x); - assert(__Pyx_PyLong_DigitCount(x) > 1); - switch (__Pyx_PyLong_SignedDigitCount(x)) { - case -2: - if ((8 * sizeof(int) - 1 > 1 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { - return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); - } + if (__Pyx_PyLong_IsCompact(x)) { + __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) + } else { + const digit* digits = __Pyx_PyLong_Digits(x); + assert(__Pyx_PyLong_DigitCount(x) > 1); + switch (__Pyx_PyLong_SignedDigitCount(x)) { + case -2: + if ((8 * sizeof(int) - 1 > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { + return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } - break; - case 2: - if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { - return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); - } + } + break; + case 2: + if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { + return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } - break; - case -3: - if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { - return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); - } + } + break; + case -3: + if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { + return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } - break; - case 3: - if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { - return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); - } + } + break; + case 3: + if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { + return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } - break; - case -4: - if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { - return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); - } + } + break; + case -4: + if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { + return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } - break; - case 4: - if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { - return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); - } + } + break; + case 4: + if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { + return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } - break; - } + } + break; } + } #endif - if ((sizeof(int) <= sizeof(long))) { - __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) + if ((sizeof(int) <= sizeof(long))) { + __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG - } else if ((sizeof(int) <= sizeof(PY_LONG_LONG))) { - __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) + } else if ((sizeof(int) <= sizeof(PY_LONG_LONG))) { + __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif - } + } + } + { + int val; + int ret = -1; +#if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API + Py_ssize_t bytes_copied = PyLong_AsNativeBytes( + x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0)); + if (unlikely(bytes_copied == -1)) { + } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) { + goto raise_overflow; + } else { + ret = 0; + } +#elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + ret = _PyLong_AsByteArray((PyLongObject *)x, + bytes, sizeof(val), + is_little, !is_unsigned); +#else + PyObject *v; + PyObject *stepval = NULL, *mask = NULL, *shift = NULL; + int bits, remaining_bits, is_negative = 0; + int chunk_size = (sizeof(long) < 8) ? 30 : 62; + if (likely(PyLong_CheckExact(x))) { + v = __Pyx_NewRef(x); + } else { + v = PyNumber_Long(x); + if (unlikely(!v)) return (int) -1; + assert(PyLong_CheckExact(v)); } { - int val; - PyObject *v = __Pyx_PyNumber_IntOrLong(x); -#if PY_MAJOR_VERSION < 3 - if (likely(v) && !PyLong_Check(v)) { - PyObject *tmp = v; - v = PyNumber_Long(tmp); - Py_DECREF(tmp); - } -#endif - if (likely(v)) { - int ret = -1; -#if !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) - int one = 1; int is_little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&val; - ret = _PyLong_AsByteArray((PyLongObject *)v, - bytes, sizeof(val), - is_little, !is_unsigned); -#else - PyObject *stepval = NULL, *mask = NULL, *shift = NULL; - int bits, remaining_bits, is_negative = 0; - long idigit; - int chunk_size = (sizeof(long) < 8) ? 30 : 62; - if (unlikely(!PyLong_CheckExact(v))) { - PyObject *tmp = v; - v = PyNumber_Long(v); - assert(PyLong_CheckExact(v)); - Py_DECREF(tmp); - if (unlikely(!v)) return (int) -1; - } -#if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 - if (Py_SIZE(x) == 0) - return (int) 0; - is_negative = Py_SIZE(x) < 0; -#else - { - int result = PyObject_RichCompareBool(x, Py_False, Py_LT); - if (unlikely(result < 0)) - return (int) -1; - is_negative = result == 1; - } -#endif - if (is_unsigned && unlikely(is_negative)) { - goto raise_neg_overflow; - } else if (is_negative) { - stepval = PyNumber_Invert(v); - if (unlikely(!stepval)) - return (int) -1; - } else { - stepval = __Pyx_NewRef(v); - } - val = (int) 0; - mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; - shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; - for (bits = 0; bits < (int) sizeof(int) * 8 - chunk_size; bits += chunk_size) { - PyObject *tmp, *digit; - digit = PyNumber_And(stepval, mask); - if (unlikely(!digit)) goto done; - idigit = PyLong_AsLong(digit); - Py_DECREF(digit); - if (unlikely(idigit < 0)) goto done; - tmp = PyNumber_Rshift(stepval, shift); - if (unlikely(!tmp)) goto done; - Py_DECREF(stepval); stepval = tmp; - val |= ((int) idigit) << bits; - #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 - if (Py_SIZE(stepval) == 0) - goto unpacking_done; - #endif - } - idigit = PyLong_AsLong(stepval); - if (unlikely(idigit < 0)) goto done; - remaining_bits = ((int) sizeof(int) * 8) - bits - (is_unsigned ? 0 : 1); - if (unlikely(idigit >= (1L << remaining_bits))) - goto raise_overflow; - val |= ((int) idigit) << bits; - #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 - unpacking_done: - #endif - if (!is_unsigned) { - if (unlikely(val & (((int) 1) << (sizeof(int) * 8 - 1)))) - goto raise_overflow; - if (is_negative) - val = ~val; - } - ret = 0; - done: - Py_XDECREF(shift); - Py_XDECREF(mask); - Py_XDECREF(stepval); -#endif + int result = PyObject_RichCompareBool(v, Py_False, Py_LT); + if (unlikely(result < 0)) { Py_DECREF(v); - if (likely(!ret)) - return val; + return (int) -1; } - return (int) -1; + is_negative = result == 1; } - } else { - int val; - PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); - if (!tmp) return (int) -1; - val = __Pyx_PyInt_As_int(tmp); - Py_DECREF(tmp); + if (is_unsigned && unlikely(is_negative)) { + Py_DECREF(v); + goto raise_neg_overflow; + } else if (is_negative) { + stepval = PyNumber_Invert(v); + Py_DECREF(v); + if (unlikely(!stepval)) + return (int) -1; + } else { + stepval = v; + } + v = NULL; + val = (int) 0; + mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; + shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; + for (bits = 0; bits < (int) sizeof(int) * 8 - chunk_size; bits += chunk_size) { + PyObject *tmp, *digit; + long idigit; + digit = PyNumber_And(stepval, mask); + if (unlikely(!digit)) goto done; + idigit = PyLong_AsLong(digit); + Py_DECREF(digit); + if (unlikely(idigit < 0)) goto done; + val |= ((int) idigit) << bits; + tmp = PyNumber_Rshift(stepval, shift); + if (unlikely(!tmp)) goto done; + Py_DECREF(stepval); stepval = tmp; + } + Py_DECREF(shift); shift = NULL; + Py_DECREF(mask); mask = NULL; + { + long idigit = PyLong_AsLong(stepval); + if (unlikely(idigit < 0)) goto done; + remaining_bits = ((int) sizeof(int) * 8) - bits - (is_unsigned ? 0 : 1); + if (unlikely(idigit >= (1L << remaining_bits))) + goto raise_overflow; + val |= ((int) idigit) << bits; + } + if (!is_unsigned) { + if (unlikely(val & (((int) 1) << (sizeof(int) * 8 - 1)))) + goto raise_overflow; + if (is_negative) + val = ~val; + } + ret = 0; + done: + Py_XDECREF(shift); + Py_XDECREF(mask); + Py_XDECREF(stepval); +#endif + if (unlikely(ret)) + return (int) -1; return val; } raise_overflow: @@ -35883,15 +36616,22 @@ static CYTHON_INLINE void __Pyx_XCLEAR_MEMVIEW(__Pyx_memviewslice *memslice, } } { - int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; -#if !CYTHON_COMPILING_IN_LIMITED_API +#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 + if (is_unsigned) { + return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); + } else { + return PyLong_FromNativeBytes(bytes, sizeof(value), -1); + } +#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 + int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(int), little, !is_unsigned); #else + int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; - from_bytes = PyObject_GetAttrString((PyObject*)&PyInt_Type, "from_bytes"); + from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(int)); if (!py_bytes) goto limited_bad; @@ -35899,16 +36639,18 @@ static CYTHON_INLINE void __Pyx_XCLEAR_MEMVIEW(__Pyx_memviewslice *memslice, if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; - kwds = PyDict_New(); - if (!kwds) goto limited_bad; - if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(!is_unsigned ? Py_True : Py_False))) goto limited_bad; + if (!is_unsigned) { + kwds = PyDict_New(); + if (!kwds) goto limited_bad; + if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; + } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: - Py_XDECREF(from_bytes); - Py_XDECREF(py_bytes); - Py_XDECREF(order_str); - Py_XDECREF(arg_tuple); Py_XDECREF(kwds); + Py_XDECREF(arg_tuple); + Py_XDECREF(order_str); + Py_XDECREF(py_bytes); + Py_XDECREF(from_bytes); return result; #endif } @@ -35945,15 +36687,22 @@ static CYTHON_INLINE void __Pyx_XCLEAR_MEMVIEW(__Pyx_memviewslice *memslice, } } { - int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; -#if !CYTHON_COMPILING_IN_LIMITED_API +#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 + if (is_unsigned) { + return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); + } else { + return PyLong_FromNativeBytes(bytes, sizeof(value), -1); + } +#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 + int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(long), little, !is_unsigned); #else + int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; - from_bytes = PyObject_GetAttrString((PyObject*)&PyInt_Type, "from_bytes"); + from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(long)); if (!py_bytes) goto limited_bad; @@ -35961,351 +36710,356 @@ static CYTHON_INLINE void __Pyx_XCLEAR_MEMVIEW(__Pyx_memviewslice *memslice, if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; - kwds = PyDict_New(); - if (!kwds) goto limited_bad; - if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(!is_unsigned ? Py_True : Py_False))) goto limited_bad; + if (!is_unsigned) { + kwds = PyDict_New(); + if (!kwds) goto limited_bad; + if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; + } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: - Py_XDECREF(from_bytes); - Py_XDECREF(py_bytes); - Py_XDECREF(order_str); - Py_XDECREF(arg_tuple); Py_XDECREF(kwds); + Py_XDECREF(arg_tuple); + Py_XDECREF(order_str); + Py_XDECREF(py_bytes); + Py_XDECREF(from_bytes); return result; #endif } } /* CIntFromPy */ - static CYTHON_INLINE npy_long __Pyx_PyInt_As_npy_long(PyObject *x) { + static CYTHON_INLINE npy_int64 __Pyx_PyInt_As_npy_int64(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif - const npy_long neg_one = (npy_long) -1, const_zero = (npy_long) 0; + const npy_int64 neg_one = (npy_int64) -1, const_zero = (npy_int64) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { - if ((sizeof(npy_long) < sizeof(long))) { - __PYX_VERIFY_RETURN_INT(npy_long, long, PyInt_AS_LONG(x)) + if ((sizeof(npy_int64) < sizeof(long))) { + __PYX_VERIFY_RETURN_INT(npy_int64, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } - return (npy_long) val; + return (npy_int64) val; } - } else + } #endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { + if (unlikely(!PyLong_Check(x))) { + npy_int64 val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (npy_int64) -1; + val = __Pyx_PyInt_As_npy_int64(tmp); + Py_DECREF(tmp); + return val; + } + if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS - if (unlikely(__Pyx_PyLong_IsNeg(x))) { - goto raise_neg_overflow; - } else if (__Pyx_PyLong_IsCompact(x)) { - __PYX_VERIFY_RETURN_INT(npy_long, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) - } else { - const digit* digits = __Pyx_PyLong_Digits(x); - assert(__Pyx_PyLong_DigitCount(x) > 1); - switch (__Pyx_PyLong_DigitCount(x)) { - case 2: - if ((8 * sizeof(npy_long) > 1 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(npy_long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(npy_long) >= 2 * PyLong_SHIFT)) { - return (npy_long) (((((npy_long)digits[1]) << PyLong_SHIFT) | (npy_long)digits[0])); - } + if (unlikely(__Pyx_PyLong_IsNeg(x))) { + goto raise_neg_overflow; + } else if (__Pyx_PyLong_IsCompact(x)) { + __PYX_VERIFY_RETURN_INT(npy_int64, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) + } else { + const digit* digits = __Pyx_PyLong_Digits(x); + assert(__Pyx_PyLong_DigitCount(x) > 1); + switch (__Pyx_PyLong_DigitCount(x)) { + case 2: + if ((8 * sizeof(npy_int64) > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(npy_int64, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(npy_int64) >= 2 * PyLong_SHIFT)) { + return (npy_int64) (((((npy_int64)digits[1]) << PyLong_SHIFT) | (npy_int64)digits[0])); } - break; - case 3: - if ((8 * sizeof(npy_long) > 2 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(npy_long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(npy_long) >= 3 * PyLong_SHIFT)) { - return (npy_long) (((((((npy_long)digits[2]) << PyLong_SHIFT) | (npy_long)digits[1]) << PyLong_SHIFT) | (npy_long)digits[0])); - } + } + break; + case 3: + if ((8 * sizeof(npy_int64) > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(npy_int64, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(npy_int64) >= 3 * PyLong_SHIFT)) { + return (npy_int64) (((((((npy_int64)digits[2]) << PyLong_SHIFT) | (npy_int64)digits[1]) << PyLong_SHIFT) | (npy_int64)digits[0])); } - break; - case 4: - if ((8 * sizeof(npy_long) > 3 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(npy_long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(npy_long) >= 4 * PyLong_SHIFT)) { - return (npy_long) (((((((((npy_long)digits[3]) << PyLong_SHIFT) | (npy_long)digits[2]) << PyLong_SHIFT) | (npy_long)digits[1]) << PyLong_SHIFT) | (npy_long)digits[0])); - } + } + break; + case 4: + if ((8 * sizeof(npy_int64) > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(npy_int64, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(npy_int64) >= 4 * PyLong_SHIFT)) { + return (npy_int64) (((((((((npy_int64)digits[3]) << PyLong_SHIFT) | (npy_int64)digits[2]) << PyLong_SHIFT) | (npy_int64)digits[1]) << PyLong_SHIFT) | (npy_int64)digits[0])); } - break; - } + } + break; } + } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 - if (unlikely(Py_SIZE(x) < 0)) { - goto raise_neg_overflow; - } + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } #else - { - int result = PyObject_RichCompareBool(x, Py_False, Py_LT); - if (unlikely(result < 0)) - return (npy_long) -1; - if (unlikely(result == 1)) - goto raise_neg_overflow; - } + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (npy_int64) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } #endif - if ((sizeof(npy_long) <= sizeof(unsigned long))) { - __PYX_VERIFY_RETURN_INT_EXC(npy_long, unsigned long, PyLong_AsUnsignedLong(x)) + if ((sizeof(npy_int64) <= sizeof(unsigned long))) { + __PYX_VERIFY_RETURN_INT_EXC(npy_int64, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG - } else if ((sizeof(npy_long) <= sizeof(unsigned PY_LONG_LONG))) { - __PYX_VERIFY_RETURN_INT_EXC(npy_long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) + } else if ((sizeof(npy_int64) <= sizeof(unsigned PY_LONG_LONG))) { + __PYX_VERIFY_RETURN_INT_EXC(npy_int64, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif - } - } else { + } + } else { #if CYTHON_USE_PYLONG_INTERNALS - if (__Pyx_PyLong_IsCompact(x)) { - __PYX_VERIFY_RETURN_INT(npy_long, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) - } else { - const digit* digits = __Pyx_PyLong_Digits(x); - assert(__Pyx_PyLong_DigitCount(x) > 1); - switch (__Pyx_PyLong_SignedDigitCount(x)) { - case -2: - if ((8 * sizeof(npy_long) - 1 > 1 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(npy_long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(npy_long) - 1 > 2 * PyLong_SHIFT)) { - return (npy_long) (((npy_long)-1)*(((((npy_long)digits[1]) << PyLong_SHIFT) | (npy_long)digits[0]))); - } + if (__Pyx_PyLong_IsCompact(x)) { + __PYX_VERIFY_RETURN_INT(npy_int64, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) + } else { + const digit* digits = __Pyx_PyLong_Digits(x); + assert(__Pyx_PyLong_DigitCount(x) > 1); + switch (__Pyx_PyLong_SignedDigitCount(x)) { + case -2: + if ((8 * sizeof(npy_int64) - 1 > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(npy_int64, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(npy_int64) - 1 > 2 * PyLong_SHIFT)) { + return (npy_int64) (((npy_int64)-1)*(((((npy_int64)digits[1]) << PyLong_SHIFT) | (npy_int64)digits[0]))); } - break; - case 2: - if ((8 * sizeof(npy_long) > 1 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(npy_long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(npy_long) - 1 > 2 * PyLong_SHIFT)) { - return (npy_long) ((((((npy_long)digits[1]) << PyLong_SHIFT) | (npy_long)digits[0]))); - } + } + break; + case 2: + if ((8 * sizeof(npy_int64) > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(npy_int64, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(npy_int64) - 1 > 2 * PyLong_SHIFT)) { + return (npy_int64) ((((((npy_int64)digits[1]) << PyLong_SHIFT) | (npy_int64)digits[0]))); } - break; - case -3: - if ((8 * sizeof(npy_long) - 1 > 2 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(npy_long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(npy_long) - 1 > 3 * PyLong_SHIFT)) { - return (npy_long) (((npy_long)-1)*(((((((npy_long)digits[2]) << PyLong_SHIFT) | (npy_long)digits[1]) << PyLong_SHIFT) | (npy_long)digits[0]))); - } + } + break; + case -3: + if ((8 * sizeof(npy_int64) - 1 > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(npy_int64, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(npy_int64) - 1 > 3 * PyLong_SHIFT)) { + return (npy_int64) (((npy_int64)-1)*(((((((npy_int64)digits[2]) << PyLong_SHIFT) | (npy_int64)digits[1]) << PyLong_SHIFT) | (npy_int64)digits[0]))); } - break; - case 3: - if ((8 * sizeof(npy_long) > 2 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(npy_long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(npy_long) - 1 > 3 * PyLong_SHIFT)) { - return (npy_long) ((((((((npy_long)digits[2]) << PyLong_SHIFT) | (npy_long)digits[1]) << PyLong_SHIFT) | (npy_long)digits[0]))); - } + } + break; + case 3: + if ((8 * sizeof(npy_int64) > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(npy_int64, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(npy_int64) - 1 > 3 * PyLong_SHIFT)) { + return (npy_int64) ((((((((npy_int64)digits[2]) << PyLong_SHIFT) | (npy_int64)digits[1]) << PyLong_SHIFT) | (npy_int64)digits[0]))); } - break; - case -4: - if ((8 * sizeof(npy_long) - 1 > 3 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(npy_long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(npy_long) - 1 > 4 * PyLong_SHIFT)) { - return (npy_long) (((npy_long)-1)*(((((((((npy_long)digits[3]) << PyLong_SHIFT) | (npy_long)digits[2]) << PyLong_SHIFT) | (npy_long)digits[1]) << PyLong_SHIFT) | (npy_long)digits[0]))); - } + } + break; + case -4: + if ((8 * sizeof(npy_int64) - 1 > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(npy_int64, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(npy_int64) - 1 > 4 * PyLong_SHIFT)) { + return (npy_int64) (((npy_int64)-1)*(((((((((npy_int64)digits[3]) << PyLong_SHIFT) | (npy_int64)digits[2]) << PyLong_SHIFT) | (npy_int64)digits[1]) << PyLong_SHIFT) | (npy_int64)digits[0]))); } - break; - case 4: - if ((8 * sizeof(npy_long) > 3 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(npy_long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(npy_long) - 1 > 4 * PyLong_SHIFT)) { - return (npy_long) ((((((((((npy_long)digits[3]) << PyLong_SHIFT) | (npy_long)digits[2]) << PyLong_SHIFT) | (npy_long)digits[1]) << PyLong_SHIFT) | (npy_long)digits[0]))); - } + } + break; + case 4: + if ((8 * sizeof(npy_int64) > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(npy_int64, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(npy_int64) - 1 > 4 * PyLong_SHIFT)) { + return (npy_int64) ((((((((((npy_int64)digits[3]) << PyLong_SHIFT) | (npy_int64)digits[2]) << PyLong_SHIFT) | (npy_int64)digits[1]) << PyLong_SHIFT) | (npy_int64)digits[0]))); } - break; - } + } + break; } + } #endif - if ((sizeof(npy_long) <= sizeof(long))) { - __PYX_VERIFY_RETURN_INT_EXC(npy_long, long, PyLong_AsLong(x)) + if ((sizeof(npy_int64) <= sizeof(long))) { + __PYX_VERIFY_RETURN_INT_EXC(npy_int64, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG - } else if ((sizeof(npy_long) <= sizeof(PY_LONG_LONG))) { - __PYX_VERIFY_RETURN_INT_EXC(npy_long, PY_LONG_LONG, PyLong_AsLongLong(x)) + } else if ((sizeof(npy_int64) <= sizeof(PY_LONG_LONG))) { + __PYX_VERIFY_RETURN_INT_EXC(npy_int64, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif - } + } + } + { + npy_int64 val; + int ret = -1; +#if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API + Py_ssize_t bytes_copied = PyLong_AsNativeBytes( + x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0)); + if (unlikely(bytes_copied == -1)) { + } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) { + goto raise_overflow; + } else { + ret = 0; + } +#elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + ret = _PyLong_AsByteArray((PyLongObject *)x, + bytes, sizeof(val), + is_little, !is_unsigned); +#else + PyObject *v; + PyObject *stepval = NULL, *mask = NULL, *shift = NULL; + int bits, remaining_bits, is_negative = 0; + int chunk_size = (sizeof(long) < 8) ? 30 : 62; + if (likely(PyLong_CheckExact(x))) { + v = __Pyx_NewRef(x); + } else { + v = PyNumber_Long(x); + if (unlikely(!v)) return (npy_int64) -1; + assert(PyLong_CheckExact(v)); } { - npy_long val; - PyObject *v = __Pyx_PyNumber_IntOrLong(x); -#if PY_MAJOR_VERSION < 3 - if (likely(v) && !PyLong_Check(v)) { - PyObject *tmp = v; - v = PyNumber_Long(tmp); - Py_DECREF(tmp); - } -#endif - if (likely(v)) { - int ret = -1; -#if !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) - int one = 1; int is_little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&val; - ret = _PyLong_AsByteArray((PyLongObject *)v, - bytes, sizeof(val), - is_little, !is_unsigned); -#else - PyObject *stepval = NULL, *mask = NULL, *shift = NULL; - int bits, remaining_bits, is_negative = 0; - long idigit; - int chunk_size = (sizeof(long) < 8) ? 30 : 62; - if (unlikely(!PyLong_CheckExact(v))) { - PyObject *tmp = v; - v = PyNumber_Long(v); - assert(PyLong_CheckExact(v)); - Py_DECREF(tmp); - if (unlikely(!v)) return (npy_long) -1; - } -#if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 - if (Py_SIZE(x) == 0) - return (npy_long) 0; - is_negative = Py_SIZE(x) < 0; -#else - { - int result = PyObject_RichCompareBool(x, Py_False, Py_LT); - if (unlikely(result < 0)) - return (npy_long) -1; - is_negative = result == 1; - } -#endif - if (is_unsigned && unlikely(is_negative)) { - goto raise_neg_overflow; - } else if (is_negative) { - stepval = PyNumber_Invert(v); - if (unlikely(!stepval)) - return (npy_long) -1; - } else { - stepval = __Pyx_NewRef(v); - } - val = (npy_long) 0; - mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; - shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; - for (bits = 0; bits < (int) sizeof(npy_long) * 8 - chunk_size; bits += chunk_size) { - PyObject *tmp, *digit; - digit = PyNumber_And(stepval, mask); - if (unlikely(!digit)) goto done; - idigit = PyLong_AsLong(digit); - Py_DECREF(digit); - if (unlikely(idigit < 0)) goto done; - tmp = PyNumber_Rshift(stepval, shift); - if (unlikely(!tmp)) goto done; - Py_DECREF(stepval); stepval = tmp; - val |= ((npy_long) idigit) << bits; - #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 - if (Py_SIZE(stepval) == 0) - goto unpacking_done; - #endif - } - idigit = PyLong_AsLong(stepval); - if (unlikely(idigit < 0)) goto done; - remaining_bits = ((int) sizeof(npy_long) * 8) - bits - (is_unsigned ? 0 : 1); - if (unlikely(idigit >= (1L << remaining_bits))) - goto raise_overflow; - val |= ((npy_long) idigit) << bits; - #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 - unpacking_done: - #endif - if (!is_unsigned) { - if (unlikely(val & (((npy_long) 1) << (sizeof(npy_long) * 8 - 1)))) - goto raise_overflow; - if (is_negative) - val = ~val; - } - ret = 0; - done: - Py_XDECREF(shift); - Py_XDECREF(mask); - Py_XDECREF(stepval); -#endif + int result = PyObject_RichCompareBool(v, Py_False, Py_LT); + if (unlikely(result < 0)) { Py_DECREF(v); - if (likely(!ret)) - return val; + return (npy_int64) -1; } - return (npy_long) -1; + is_negative = result == 1; } - } else { - npy_long val; - PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); - if (!tmp) return (npy_long) -1; - val = __Pyx_PyInt_As_npy_long(tmp); - Py_DECREF(tmp); + if (is_unsigned && unlikely(is_negative)) { + Py_DECREF(v); + goto raise_neg_overflow; + } else if (is_negative) { + stepval = PyNumber_Invert(v); + Py_DECREF(v); + if (unlikely(!stepval)) + return (npy_int64) -1; + } else { + stepval = v; + } + v = NULL; + val = (npy_int64) 0; + mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; + shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; + for (bits = 0; bits < (int) sizeof(npy_int64) * 8 - chunk_size; bits += chunk_size) { + PyObject *tmp, *digit; + long idigit; + digit = PyNumber_And(stepval, mask); + if (unlikely(!digit)) goto done; + idigit = PyLong_AsLong(digit); + Py_DECREF(digit); + if (unlikely(idigit < 0)) goto done; + val |= ((npy_int64) idigit) << bits; + tmp = PyNumber_Rshift(stepval, shift); + if (unlikely(!tmp)) goto done; + Py_DECREF(stepval); stepval = tmp; + } + Py_DECREF(shift); shift = NULL; + Py_DECREF(mask); mask = NULL; + { + long idigit = PyLong_AsLong(stepval); + if (unlikely(idigit < 0)) goto done; + remaining_bits = ((int) sizeof(npy_int64) * 8) - bits - (is_unsigned ? 0 : 1); + if (unlikely(idigit >= (1L << remaining_bits))) + goto raise_overflow; + val |= ((npy_int64) idigit) << bits; + } + if (!is_unsigned) { + if (unlikely(val & (((npy_int64) 1) << (sizeof(npy_int64) * 8 - 1)))) + goto raise_overflow; + if (is_negative) + val = ~val; + } + ret = 0; + done: + Py_XDECREF(shift); + Py_XDECREF(mask); + Py_XDECREF(stepval); +#endif + if (unlikely(ret)) + return (npy_int64) -1; return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, - "value too large to convert to npy_long"); - return (npy_long) -1; + "value too large to convert to npy_int64"); + return (npy_int64) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to npy_long"); - return (npy_long) -1; + "can't convert negative value to npy_int64"); + return (npy_int64) -1; } /* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_long(npy_long value) { + static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int64(npy_int64 value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif - const npy_long neg_one = (npy_long) -1, const_zero = (npy_long) 0; + const npy_int64 neg_one = (npy_int64) -1, const_zero = (npy_int64) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { - if (sizeof(npy_long) < sizeof(long)) { + if (sizeof(npy_int64) < sizeof(long)) { return PyInt_FromLong((long) value); - } else if (sizeof(npy_long) <= sizeof(unsigned long)) { + } else if (sizeof(npy_int64) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG - } else if (sizeof(npy_long) <= sizeof(unsigned PY_LONG_LONG)) { + } else if (sizeof(npy_int64) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { - if (sizeof(npy_long) <= sizeof(long)) { + if (sizeof(npy_int64) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG - } else if (sizeof(npy_long) <= sizeof(PY_LONG_LONG)) { + } else if (sizeof(npy_int64) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { - int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; -#if !CYTHON_COMPILING_IN_LIMITED_API - return _PyLong_FromByteArray(bytes, sizeof(npy_long), +#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 + if (is_unsigned) { + return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); + } else { + return PyLong_FromNativeBytes(bytes, sizeof(value), -1); + } +#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 + int one = 1; int little = (int)*(unsigned char *)&one; + return _PyLong_FromByteArray(bytes, sizeof(npy_int64), little, !is_unsigned); #else + int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; - from_bytes = PyObject_GetAttrString((PyObject*)&PyInt_Type, "from_bytes"); + from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; - py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(npy_long)); + py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(npy_int64)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; - kwds = PyDict_New(); - if (!kwds) goto limited_bad; - if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(!is_unsigned ? Py_True : Py_False))) goto limited_bad; + if (!is_unsigned) { + kwds = PyDict_New(); + if (!kwds) goto limited_bad; + if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; + } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: - Py_XDECREF(from_bytes); - Py_XDECREF(py_bytes); - Py_XDECREF(order_str); - Py_XDECREF(arg_tuple); Py_XDECREF(kwds); + Py_XDECREF(arg_tuple); + Py_XDECREF(order_str); + Py_XDECREF(py_bytes); + Py_XDECREF(from_bytes); return result; #endif } @@ -36370,245 +37124,239 @@ static int __Pyx_PrintOne(PyObject* stream, PyObject *o) { } return (long) val; } - } else + } #endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { + if (unlikely(!PyLong_Check(x))) { + long val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (long) -1; + val = __Pyx_PyInt_As_long(tmp); + Py_DECREF(tmp); + return val; + } + if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS - if (unlikely(__Pyx_PyLong_IsNeg(x))) { - goto raise_neg_overflow; - } else if (__Pyx_PyLong_IsCompact(x)) { - __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) - } else { - const digit* digits = __Pyx_PyLong_Digits(x); - assert(__Pyx_PyLong_DigitCount(x) > 1); - switch (__Pyx_PyLong_DigitCount(x)) { - case 2: - if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(long) >= 2 * PyLong_SHIFT)) { - return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); - } + if (unlikely(__Pyx_PyLong_IsNeg(x))) { + goto raise_neg_overflow; + } else if (__Pyx_PyLong_IsCompact(x)) { + __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) + } else { + const digit* digits = __Pyx_PyLong_Digits(x); + assert(__Pyx_PyLong_DigitCount(x) > 1); + switch (__Pyx_PyLong_DigitCount(x)) { + case 2: + if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) >= 2 * PyLong_SHIFT)) { + return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } - break; - case 3: - if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(long) >= 3 * PyLong_SHIFT)) { - return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); - } + } + break; + case 3: + if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) >= 3 * PyLong_SHIFT)) { + return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } - break; - case 4: - if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(long) >= 4 * PyLong_SHIFT)) { - return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); - } + } + break; + case 4: + if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) >= 4 * PyLong_SHIFT)) { + return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } - break; - } + } + break; } + } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 - if (unlikely(Py_SIZE(x) < 0)) { - goto raise_neg_overflow; - } + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } #else - { - int result = PyObject_RichCompareBool(x, Py_False, Py_LT); - if (unlikely(result < 0)) - return (long) -1; - if (unlikely(result == 1)) - goto raise_neg_overflow; - } + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (long) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } #endif - if ((sizeof(long) <= sizeof(unsigned long))) { - __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) + if ((sizeof(long) <= sizeof(unsigned long))) { + __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG - } else if ((sizeof(long) <= sizeof(unsigned PY_LONG_LONG))) { - __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) + } else if ((sizeof(long) <= sizeof(unsigned PY_LONG_LONG))) { + __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif - } - } else { + } + } else { #if CYTHON_USE_PYLONG_INTERNALS - if (__Pyx_PyLong_IsCompact(x)) { - __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) - } else { - const digit* digits = __Pyx_PyLong_Digits(x); - assert(__Pyx_PyLong_DigitCount(x) > 1); - switch (__Pyx_PyLong_SignedDigitCount(x)) { - case -2: - if ((8 * sizeof(long) - 1 > 1 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { - return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); - } + if (__Pyx_PyLong_IsCompact(x)) { + __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) + } else { + const digit* digits = __Pyx_PyLong_Digits(x); + assert(__Pyx_PyLong_DigitCount(x) > 1); + switch (__Pyx_PyLong_SignedDigitCount(x)) { + case -2: + if ((8 * sizeof(long) - 1 > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { + return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } - break; - case 2: - if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { - return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); - } + } + break; + case 2: + if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { + return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } - break; - case -3: - if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { - return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); - } + } + break; + case -3: + if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { + return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } - break; - case 3: - if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { - return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); - } + } + break; + case 3: + if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { + return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } - break; - case -4: - if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { - return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); - } + } + break; + case -4: + if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { + return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } - break; - case 4: - if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { - return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); - } + } + break; + case 4: + if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { + return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } - break; - } + } + break; } + } #endif - if ((sizeof(long) <= sizeof(long))) { - __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) + if ((sizeof(long) <= sizeof(long))) { + __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG - } else if ((sizeof(long) <= sizeof(PY_LONG_LONG))) { - __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) + } else if ((sizeof(long) <= sizeof(PY_LONG_LONG))) { + __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif - } + } + } + { + long val; + int ret = -1; +#if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API + Py_ssize_t bytes_copied = PyLong_AsNativeBytes( + x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0)); + if (unlikely(bytes_copied == -1)) { + } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) { + goto raise_overflow; + } else { + ret = 0; + } +#elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + ret = _PyLong_AsByteArray((PyLongObject *)x, + bytes, sizeof(val), + is_little, !is_unsigned); +#else + PyObject *v; + PyObject *stepval = NULL, *mask = NULL, *shift = NULL; + int bits, remaining_bits, is_negative = 0; + int chunk_size = (sizeof(long) < 8) ? 30 : 62; + if (likely(PyLong_CheckExact(x))) { + v = __Pyx_NewRef(x); + } else { + v = PyNumber_Long(x); + if (unlikely(!v)) return (long) -1; + assert(PyLong_CheckExact(v)); } { - long val; - PyObject *v = __Pyx_PyNumber_IntOrLong(x); -#if PY_MAJOR_VERSION < 3 - if (likely(v) && !PyLong_Check(v)) { - PyObject *tmp = v; - v = PyNumber_Long(tmp); - Py_DECREF(tmp); - } -#endif - if (likely(v)) { - int ret = -1; -#if !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) - int one = 1; int is_little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&val; - ret = _PyLong_AsByteArray((PyLongObject *)v, - bytes, sizeof(val), - is_little, !is_unsigned); -#else - PyObject *stepval = NULL, *mask = NULL, *shift = NULL; - int bits, remaining_bits, is_negative = 0; - long idigit; - int chunk_size = (sizeof(long) < 8) ? 30 : 62; - if (unlikely(!PyLong_CheckExact(v))) { - PyObject *tmp = v; - v = PyNumber_Long(v); - assert(PyLong_CheckExact(v)); - Py_DECREF(tmp); - if (unlikely(!v)) return (long) -1; - } -#if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 - if (Py_SIZE(x) == 0) - return (long) 0; - is_negative = Py_SIZE(x) < 0; -#else - { - int result = PyObject_RichCompareBool(x, Py_False, Py_LT); - if (unlikely(result < 0)) - return (long) -1; - is_negative = result == 1; - } -#endif - if (is_unsigned && unlikely(is_negative)) { - goto raise_neg_overflow; - } else if (is_negative) { - stepval = PyNumber_Invert(v); - if (unlikely(!stepval)) - return (long) -1; - } else { - stepval = __Pyx_NewRef(v); - } - val = (long) 0; - mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; - shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; - for (bits = 0; bits < (int) sizeof(long) * 8 - chunk_size; bits += chunk_size) { - PyObject *tmp, *digit; - digit = PyNumber_And(stepval, mask); - if (unlikely(!digit)) goto done; - idigit = PyLong_AsLong(digit); - Py_DECREF(digit); - if (unlikely(idigit < 0)) goto done; - tmp = PyNumber_Rshift(stepval, shift); - if (unlikely(!tmp)) goto done; - Py_DECREF(stepval); stepval = tmp; - val |= ((long) idigit) << bits; - #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 - if (Py_SIZE(stepval) == 0) - goto unpacking_done; - #endif - } - idigit = PyLong_AsLong(stepval); - if (unlikely(idigit < 0)) goto done; - remaining_bits = ((int) sizeof(long) * 8) - bits - (is_unsigned ? 0 : 1); - if (unlikely(idigit >= (1L << remaining_bits))) - goto raise_overflow; - val |= ((long) idigit) << bits; - #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 - unpacking_done: - #endif - if (!is_unsigned) { - if (unlikely(val & (((long) 1) << (sizeof(long) * 8 - 1)))) - goto raise_overflow; - if (is_negative) - val = ~val; - } - ret = 0; - done: - Py_XDECREF(shift); - Py_XDECREF(mask); - Py_XDECREF(stepval); -#endif + int result = PyObject_RichCompareBool(v, Py_False, Py_LT); + if (unlikely(result < 0)) { Py_DECREF(v); - if (likely(!ret)) - return val; + return (long) -1; } - return (long) -1; + is_negative = result == 1; } - } else { - long val; - PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); - if (!tmp) return (long) -1; - val = __Pyx_PyInt_As_long(tmp); - Py_DECREF(tmp); + if (is_unsigned && unlikely(is_negative)) { + Py_DECREF(v); + goto raise_neg_overflow; + } else if (is_negative) { + stepval = PyNumber_Invert(v); + Py_DECREF(v); + if (unlikely(!stepval)) + return (long) -1; + } else { + stepval = v; + } + v = NULL; + val = (long) 0; + mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; + shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; + for (bits = 0; bits < (int) sizeof(long) * 8 - chunk_size; bits += chunk_size) { + PyObject *tmp, *digit; + long idigit; + digit = PyNumber_And(stepval, mask); + if (unlikely(!digit)) goto done; + idigit = PyLong_AsLong(digit); + Py_DECREF(digit); + if (unlikely(idigit < 0)) goto done; + val |= ((long) idigit) << bits; + tmp = PyNumber_Rshift(stepval, shift); + if (unlikely(!tmp)) goto done; + Py_DECREF(stepval); stepval = tmp; + } + Py_DECREF(shift); shift = NULL; + Py_DECREF(mask); mask = NULL; + { + long idigit = PyLong_AsLong(stepval); + if (unlikely(idigit < 0)) goto done; + remaining_bits = ((int) sizeof(long) * 8) - bits - (is_unsigned ? 0 : 1); + if (unlikely(idigit >= (1L << remaining_bits))) + goto raise_overflow; + val |= ((long) idigit) << bits; + } + if (!is_unsigned) { + if (unlikely(val & (((long) 1) << (sizeof(long) * 8 - 1)))) + goto raise_overflow; + if (is_negative) + val = ~val; + } + ret = 0; + done: + Py_XDECREF(shift); + Py_XDECREF(mask); + Py_XDECREF(stepval); +#endif + if (unlikely(ret)) + return (long) -1; return val; } raise_overflow: @@ -36643,245 +37391,239 @@ static int __Pyx_PrintOne(PyObject* stream, PyObject *o) { } return (char) val; } - } else + } #endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { + if (unlikely(!PyLong_Check(x))) { + char val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (char) -1; + val = __Pyx_PyInt_As_char(tmp); + Py_DECREF(tmp); + return val; + } + if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS - if (unlikely(__Pyx_PyLong_IsNeg(x))) { - goto raise_neg_overflow; - } else if (__Pyx_PyLong_IsCompact(x)) { - __PYX_VERIFY_RETURN_INT(char, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) - } else { - const digit* digits = __Pyx_PyLong_Digits(x); - assert(__Pyx_PyLong_DigitCount(x) > 1); - switch (__Pyx_PyLong_DigitCount(x)) { - case 2: - if ((8 * sizeof(char) > 1 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(char) >= 2 * PyLong_SHIFT)) { - return (char) (((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])); - } + if (unlikely(__Pyx_PyLong_IsNeg(x))) { + goto raise_neg_overflow; + } else if (__Pyx_PyLong_IsCompact(x)) { + __PYX_VERIFY_RETURN_INT(char, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) + } else { + const digit* digits = __Pyx_PyLong_Digits(x); + assert(__Pyx_PyLong_DigitCount(x) > 1); + switch (__Pyx_PyLong_DigitCount(x)) { + case 2: + if ((8 * sizeof(char) > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(char) >= 2 * PyLong_SHIFT)) { + return (char) (((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])); } - break; - case 3: - if ((8 * sizeof(char) > 2 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(char) >= 3 * PyLong_SHIFT)) { - return (char) (((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])); - } + } + break; + case 3: + if ((8 * sizeof(char) > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(char) >= 3 * PyLong_SHIFT)) { + return (char) (((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])); } - break; - case 4: - if ((8 * sizeof(char) > 3 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(char) >= 4 * PyLong_SHIFT)) { - return (char) (((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])); - } + } + break; + case 4: + if ((8 * sizeof(char) > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(char) >= 4 * PyLong_SHIFT)) { + return (char) (((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])); } - break; - } + } + break; } + } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 - if (unlikely(Py_SIZE(x) < 0)) { - goto raise_neg_overflow; - } + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } #else - { - int result = PyObject_RichCompareBool(x, Py_False, Py_LT); - if (unlikely(result < 0)) - return (char) -1; - if (unlikely(result == 1)) - goto raise_neg_overflow; - } + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (char) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } #endif - if ((sizeof(char) <= sizeof(unsigned long))) { - __PYX_VERIFY_RETURN_INT_EXC(char, unsigned long, PyLong_AsUnsignedLong(x)) + if ((sizeof(char) <= sizeof(unsigned long))) { + __PYX_VERIFY_RETURN_INT_EXC(char, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG - } else if ((sizeof(char) <= sizeof(unsigned PY_LONG_LONG))) { - __PYX_VERIFY_RETURN_INT_EXC(char, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) + } else if ((sizeof(char) <= sizeof(unsigned PY_LONG_LONG))) { + __PYX_VERIFY_RETURN_INT_EXC(char, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif - } - } else { + } + } else { #if CYTHON_USE_PYLONG_INTERNALS - if (__Pyx_PyLong_IsCompact(x)) { - __PYX_VERIFY_RETURN_INT(char, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) - } else { - const digit* digits = __Pyx_PyLong_Digits(x); - assert(__Pyx_PyLong_DigitCount(x) > 1); - switch (__Pyx_PyLong_SignedDigitCount(x)) { - case -2: - if ((8 * sizeof(char) - 1 > 1 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(char) - 1 > 2 * PyLong_SHIFT)) { - return (char) (((char)-1)*(((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0]))); - } + if (__Pyx_PyLong_IsCompact(x)) { + __PYX_VERIFY_RETURN_INT(char, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) + } else { + const digit* digits = __Pyx_PyLong_Digits(x); + assert(__Pyx_PyLong_DigitCount(x) > 1); + switch (__Pyx_PyLong_SignedDigitCount(x)) { + case -2: + if ((8 * sizeof(char) - 1 > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(char) - 1 > 2 * PyLong_SHIFT)) { + return (char) (((char)-1)*(((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0]))); } - break; - case 2: - if ((8 * sizeof(char) > 1 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(char) - 1 > 2 * PyLong_SHIFT)) { - return (char) ((((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0]))); - } + } + break; + case 2: + if ((8 * sizeof(char) > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(char) - 1 > 2 * PyLong_SHIFT)) { + return (char) ((((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0]))); } - break; - case -3: - if ((8 * sizeof(char) - 1 > 2 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(char) - 1 > 3 * PyLong_SHIFT)) { - return (char) (((char)-1)*(((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]))); - } + } + break; + case -3: + if ((8 * sizeof(char) - 1 > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(char) - 1 > 3 * PyLong_SHIFT)) { + return (char) (((char)-1)*(((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]))); } - break; - case 3: - if ((8 * sizeof(char) > 2 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(char) - 1 > 3 * PyLong_SHIFT)) { - return (char) ((((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]))); - } + } + break; + case 3: + if ((8 * sizeof(char) > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(char) - 1 > 3 * PyLong_SHIFT)) { + return (char) ((((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]))); } - break; - case -4: - if ((8 * sizeof(char) - 1 > 3 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(char) - 1 > 4 * PyLong_SHIFT)) { - return (char) (((char)-1)*(((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]))); - } + } + break; + case -4: + if ((8 * sizeof(char) - 1 > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(char) - 1 > 4 * PyLong_SHIFT)) { + return (char) (((char)-1)*(((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]))); } - break; - case 4: - if ((8 * sizeof(char) > 3 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(char) - 1 > 4 * PyLong_SHIFT)) { - return (char) ((((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]))); - } + } + break; + case 4: + if ((8 * sizeof(char) > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(char) - 1 > 4 * PyLong_SHIFT)) { + return (char) ((((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]))); } - break; - } + } + break; } + } #endif - if ((sizeof(char) <= sizeof(long))) { - __PYX_VERIFY_RETURN_INT_EXC(char, long, PyLong_AsLong(x)) + if ((sizeof(char) <= sizeof(long))) { + __PYX_VERIFY_RETURN_INT_EXC(char, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG - } else if ((sizeof(char) <= sizeof(PY_LONG_LONG))) { - __PYX_VERIFY_RETURN_INT_EXC(char, PY_LONG_LONG, PyLong_AsLongLong(x)) + } else if ((sizeof(char) <= sizeof(PY_LONG_LONG))) { + __PYX_VERIFY_RETURN_INT_EXC(char, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif - } + } + } + { + char val; + int ret = -1; +#if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API + Py_ssize_t bytes_copied = PyLong_AsNativeBytes( + x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0)); + if (unlikely(bytes_copied == -1)) { + } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) { + goto raise_overflow; + } else { + ret = 0; + } +#elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + ret = _PyLong_AsByteArray((PyLongObject *)x, + bytes, sizeof(val), + is_little, !is_unsigned); +#else + PyObject *v; + PyObject *stepval = NULL, *mask = NULL, *shift = NULL; + int bits, remaining_bits, is_negative = 0; + int chunk_size = (sizeof(long) < 8) ? 30 : 62; + if (likely(PyLong_CheckExact(x))) { + v = __Pyx_NewRef(x); + } else { + v = PyNumber_Long(x); + if (unlikely(!v)) return (char) -1; + assert(PyLong_CheckExact(v)); } { - char val; - PyObject *v = __Pyx_PyNumber_IntOrLong(x); -#if PY_MAJOR_VERSION < 3 - if (likely(v) && !PyLong_Check(v)) { - PyObject *tmp = v; - v = PyNumber_Long(tmp); - Py_DECREF(tmp); - } -#endif - if (likely(v)) { - int ret = -1; -#if !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) - int one = 1; int is_little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&val; - ret = _PyLong_AsByteArray((PyLongObject *)v, - bytes, sizeof(val), - is_little, !is_unsigned); -#else - PyObject *stepval = NULL, *mask = NULL, *shift = NULL; - int bits, remaining_bits, is_negative = 0; - long idigit; - int chunk_size = (sizeof(long) < 8) ? 30 : 62; - if (unlikely(!PyLong_CheckExact(v))) { - PyObject *tmp = v; - v = PyNumber_Long(v); - assert(PyLong_CheckExact(v)); - Py_DECREF(tmp); - if (unlikely(!v)) return (char) -1; - } -#if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 - if (Py_SIZE(x) == 0) - return (char) 0; - is_negative = Py_SIZE(x) < 0; -#else - { - int result = PyObject_RichCompareBool(x, Py_False, Py_LT); - if (unlikely(result < 0)) - return (char) -1; - is_negative = result == 1; - } -#endif - if (is_unsigned && unlikely(is_negative)) { - goto raise_neg_overflow; - } else if (is_negative) { - stepval = PyNumber_Invert(v); - if (unlikely(!stepval)) - return (char) -1; - } else { - stepval = __Pyx_NewRef(v); - } - val = (char) 0; - mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; - shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; - for (bits = 0; bits < (int) sizeof(char) * 8 - chunk_size; bits += chunk_size) { - PyObject *tmp, *digit; - digit = PyNumber_And(stepval, mask); - if (unlikely(!digit)) goto done; - idigit = PyLong_AsLong(digit); - Py_DECREF(digit); - if (unlikely(idigit < 0)) goto done; - tmp = PyNumber_Rshift(stepval, shift); - if (unlikely(!tmp)) goto done; - Py_DECREF(stepval); stepval = tmp; - val |= ((char) idigit) << bits; - #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 - if (Py_SIZE(stepval) == 0) - goto unpacking_done; - #endif - } - idigit = PyLong_AsLong(stepval); - if (unlikely(idigit < 0)) goto done; - remaining_bits = ((int) sizeof(char) * 8) - bits - (is_unsigned ? 0 : 1); - if (unlikely(idigit >= (1L << remaining_bits))) - goto raise_overflow; - val |= ((char) idigit) << bits; - #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 - unpacking_done: - #endif - if (!is_unsigned) { - if (unlikely(val & (((char) 1) << (sizeof(char) * 8 - 1)))) - goto raise_overflow; - if (is_negative) - val = ~val; - } - ret = 0; - done: - Py_XDECREF(shift); - Py_XDECREF(mask); - Py_XDECREF(stepval); -#endif + int result = PyObject_RichCompareBool(v, Py_False, Py_LT); + if (unlikely(result < 0)) { Py_DECREF(v); - if (likely(!ret)) - return val; + return (char) -1; } - return (char) -1; + is_negative = result == 1; } - } else { - char val; - PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); - if (!tmp) return (char) -1; - val = __Pyx_PyInt_As_char(tmp); - Py_DECREF(tmp); + if (is_unsigned && unlikely(is_negative)) { + Py_DECREF(v); + goto raise_neg_overflow; + } else if (is_negative) { + stepval = PyNumber_Invert(v); + Py_DECREF(v); + if (unlikely(!stepval)) + return (char) -1; + } else { + stepval = v; + } + v = NULL; + val = (char) 0; + mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; + shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; + for (bits = 0; bits < (int) sizeof(char) * 8 - chunk_size; bits += chunk_size) { + PyObject *tmp, *digit; + long idigit; + digit = PyNumber_And(stepval, mask); + if (unlikely(!digit)) goto done; + idigit = PyLong_AsLong(digit); + Py_DECREF(digit); + if (unlikely(idigit < 0)) goto done; + val |= ((char) idigit) << bits; + tmp = PyNumber_Rshift(stepval, shift); + if (unlikely(!tmp)) goto done; + Py_DECREF(stepval); stepval = tmp; + } + Py_DECREF(shift); shift = NULL; + Py_DECREF(mask); mask = NULL; + { + long idigit = PyLong_AsLong(stepval); + if (unlikely(idigit < 0)) goto done; + remaining_bits = ((int) sizeof(char) * 8) - bits - (is_unsigned ? 0 : 1); + if (unlikely(idigit >= (1L << remaining_bits))) + goto raise_overflow; + val |= ((char) idigit) << bits; + } + if (!is_unsigned) { + if (unlikely(val & (((char) 1) << (sizeof(char) * 8 - 1)))) + goto raise_overflow; + if (is_negative) + val = ~val; + } + ret = 0; + done: + Py_XDECREF(shift); + Py_XDECREF(mask); + Py_XDECREF(stepval); +#endif + if (unlikely(ret)) + return (char) -1; return val; } raise_overflow: @@ -36911,7 +37653,7 @@ __Pyx_PyType_GetName(PyTypeObject* tp) #endif /* CheckBinaryVersion */ - static unsigned long __Pyx_get_runtime_version() { + static unsigned long __Pyx_get_runtime_version(void) { #if __PYX_LIMITED_VERSION_HEX >= 0x030B00A4 return Py_Version & ~0xFFUL; #else