diff --git a/pyndl/__init__.py b/pyndl/__init__.py index 4f6a19a..cfa48ad 100644 --- a/pyndl/__init__.py +++ b/pyndl/__init__.py @@ -17,7 +17,7 @@ __author__ = ('Konstantin Sering, Marc Weitz, ' 'David-Elias Künstle, Lennard Schneider') __author_email__ = 'konstantin.sering@uni-tuebingen.de' -__version__ = '0.6.0' +__version__ = '0.6.1' __license__ = 'MIT' __description__ = ('Naive discriminative learning implements learning and ' 'classification models based on the Rescorla-Wagner ' diff --git a/pyndl/ndl_parallel.c b/pyndl/ndl_parallel.c index 014c3ea..99d2dc4 100644 --- a/pyndl/ndl_parallel.c +++ b/pyndl/ndl_parallel.c @@ -1,4 +1,4 @@ -/* Generated by Cython 0.27.3 */ +/* Generated by Cython 0.28.2 */ #define PY_SSIZE_T_CLEAN #include "Python.h" @@ -7,7 +7,7 @@ #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) #error Cython requires Python 2.6+ or Python 3.3+. #else -#define CYTHON_ABI "0_27_3" +#define CYTHON_ABI "0_28_2" #define CYTHON_FUTURE_DIVISION 0 #include #ifndef offsetof @@ -183,6 +183,103 @@ #undef BASE #undef MASK #endif +#ifndef __has_attribute + #define __has_attribute(x) 0 +#endif +#ifndef __has_cpp_attribute + #define __has_cpp_attribute(x) 0 +#endif +#ifndef CYTHON_RESTRICT + #if defined(__GNUC__) + #define CYTHON_RESTRICT __restrict__ + #elif defined(_MSC_VER) && _MSC_VER >= 1400 + #define CYTHON_RESTRICT __restrict + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_RESTRICT restrict + #else + #define CYTHON_RESTRICT + #endif +#endif +#ifndef CYTHON_UNUSED +# if defined(__GNUC__) +# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +#endif +#ifndef CYTHON_MAYBE_UNUSED_VAR +# if defined(__cplusplus) + template void CYTHON_MAYBE_UNUSED_VAR( const T& ) { } +# else +# define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x) +# endif +#endif +#ifndef CYTHON_NCP_UNUSED +# if CYTHON_COMPILING_IN_CPYTHON +# define CYTHON_NCP_UNUSED +# else +# define CYTHON_NCP_UNUSED CYTHON_UNUSED +# endif +#endif +#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) +#ifdef _MSC_VER + #ifndef _MSC_STDINT_H_ + #if _MSC_VER < 1300 + typedef unsigned char uint8_t; + typedef unsigned int uint32_t; + #else + typedef unsigned __int8 uint8_t; + typedef unsigned __int32 uint32_t; + #endif + #endif +#else + #include +#endif +#ifndef CYTHON_FALLTHROUGH + #if defined(__cplusplus) && __cplusplus >= 201103L + #if __has_cpp_attribute(fallthrough) + #define CYTHON_FALLTHROUGH [[fallthrough]] + #elif __has_cpp_attribute(clang::fallthrough) + #define CYTHON_FALLTHROUGH [[clang::fallthrough]] + #elif __has_cpp_attribute(gnu::fallthrough) + #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] + #endif + #endif + #ifndef CYTHON_FALLTHROUGH + #if __has_attribute(fallthrough) + #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) + #else + #define CYTHON_FALLTHROUGH + #endif + #endif + #if defined(__clang__ ) && defined(__apple_build_version__) + #if __apple_build_version__ < 7000000 + #undef CYTHON_FALLTHROUGH + #define CYTHON_FALLTHROUGH + #endif + #endif +#endif + +#ifndef CYTHON_INLINE + #if defined(__clang__) + #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) + #elif defined(__GNUC__) + #define CYTHON_INLINE __inline__ + #elif defined(_MSC_VER) + #define CYTHON_INLINE __inline + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_INLINE inline + #else + #define CYTHON_INLINE + #endif +#endif + #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) #define Py_OptimizeFlag 0 #endif @@ -211,12 +308,12 @@ #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif -#if PY_VERSION_HEX < 0x030700A0 || !defined(METH_FASTCALL) +#if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) #ifndef METH_FASTCALL #define METH_FASTCALL 0x80 #endif - typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject **args, Py_ssize_t nargs); - typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject **args, + typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs); + typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames); #else #define __Pyx_PyCFunctionFast _PyCFunctionFast @@ -228,6 +325,18 @@ #else #define __Pyx_PyFastCFunction_Check(func) 0 #endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) + #define PyObject_Malloc(s) PyMem_Malloc(s) + #define PyObject_Free(p) PyMem_Free(p) + #define PyObject_Realloc(p) PyMem_Realloc(p) +#endif +#if CYTHON_COMPILING_IN_PYSTON + #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno) +#else + #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) +#endif #if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000 #define __Pyx_PyThreadState_Current PyThreadState_GET() #elif PY_VERSION_HEX >= 0x03060000 @@ -237,6 +346,36 @@ #else #define __Pyx_PyThreadState_Current _PyThreadState_Current #endif +#if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) +#include "pythread.h" +#define Py_tss_NEEDS_INIT 0 +typedef int Py_tss_t; +static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { + *key = PyThread_create_key(); + return 0; // PyThread_create_key reports success always +} +static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { + Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); + *key = Py_tss_NEEDS_INIT; + return key; +} +static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { + PyObject_Free(key); +} +static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { + return *key != Py_tss_NEEDS_INIT; +} +static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { + PyThread_delete_key(*key); + *key = Py_tss_NEEDS_INIT; +} +static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { + return PyThread_set_key_value(*key, value); +} +static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { + return PyThread_get_key_value(*key); +} +#endif // TSS (Thread Specific Storage) API #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized) #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) #else @@ -249,6 +388,11 @@ #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 >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS +#define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) +#else +#define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name) +#endif #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) #define CYTHON_PEP393_ENABLED 1 #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ @@ -293,18 +437,6 @@ #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format) #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) #endif -#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) - #define PyObject_Malloc(s) PyMem_Malloc(s) - #define PyObject_Free(p) PyMem_Free(p) - #define PyObject_Realloc(p) PyMem_Realloc(p) -#endif -#if CYTHON_COMPILING_IN_PYSTON - #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co) - #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno) -#else - #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) - #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) -#endif #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) #if PY_MAJOR_VERSION >= 3 @@ -332,7 +464,11 @@ #ifndef PySet_CheckExact #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) #endif -#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) +#if CYTHON_ASSUME_SAFE_MACROS + #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) +#else + #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) +#endif #if PY_MAJOR_VERSION >= 3 #define PyIntObject PyLongObject #define PyInt_Type PyLong_Type @@ -367,16 +503,10 @@ #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t #endif #if PY_MAJOR_VERSION >= 3 - #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) + #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : (Py_INCREF(func), func)) #else #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) #endif -#ifndef __has_attribute - #define __has_attribute(x) 0 -#endif -#ifndef __has_cpp_attribute - #define __has_cpp_attribute(x) 0 -#endif #if CYTHON_USE_ASYNC_SLOTS #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods @@ -394,96 +524,6 @@ unaryfunc am_anext; } __Pyx_PyAsyncMethodsStruct; #endif -#ifndef CYTHON_RESTRICT - #if defined(__GNUC__) - #define CYTHON_RESTRICT __restrict__ - #elif defined(_MSC_VER) && _MSC_VER >= 1400 - #define CYTHON_RESTRICT __restrict - #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L - #define CYTHON_RESTRICT restrict - #else - #define CYTHON_RESTRICT - #endif -#endif -#ifndef CYTHON_UNUSED -# if defined(__GNUC__) -# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) -# define CYTHON_UNUSED __attribute__ ((__unused__)) -# else -# define CYTHON_UNUSED -# endif -# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) -# define CYTHON_UNUSED __attribute__ ((__unused__)) -# else -# define CYTHON_UNUSED -# endif -#endif -#ifndef CYTHON_MAYBE_UNUSED_VAR -# if defined(__cplusplus) - template void CYTHON_MAYBE_UNUSED_VAR( const T& ) { } -# else -# define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x) -# endif -#endif -#ifndef CYTHON_NCP_UNUSED -# if CYTHON_COMPILING_IN_CPYTHON -# define CYTHON_NCP_UNUSED -# else -# define CYTHON_NCP_UNUSED CYTHON_UNUSED -# endif -#endif -#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) -#ifdef _MSC_VER - #ifndef _MSC_STDINT_H_ - #if _MSC_VER < 1300 - typedef unsigned char uint8_t; - typedef unsigned int uint32_t; - #else - typedef unsigned __int8 uint8_t; - typedef unsigned __int32 uint32_t; - #endif - #endif -#else - #include -#endif -#ifndef CYTHON_FALLTHROUGH - #if defined(__cplusplus) && __cplusplus >= 201103L - #if __has_cpp_attribute(fallthrough) - #define CYTHON_FALLTHROUGH [[fallthrough]] - #elif __has_cpp_attribute(clang::fallthrough) - #define CYTHON_FALLTHROUGH [[clang::fallthrough]] - #elif __has_cpp_attribute(gnu::fallthrough) - #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] - #endif - #endif - #ifndef CYTHON_FALLTHROUGH - #if __has_attribute(fallthrough) - #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) - #else - #define CYTHON_FALLTHROUGH - #endif - #endif - #if defined(__clang__ ) && defined(__apple_build_version__) - #if __apple_build_version__ < 7000000 - #undef CYTHON_FALLTHROUGH - #define CYTHON_FALLTHROUGH - #endif - #endif -#endif - -#ifndef CYTHON_INLINE - #if defined(__clang__) - #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) - #elif defined(__GNUC__) - #define CYTHON_INLINE __inline__ - #elif defined(_MSC_VER) - #define CYTHON_INLINE __inline - #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L - #define CYTHON_INLINE inline - #else - #define CYTHON_INLINE - #endif -#endif #if defined(WIN32) || defined(MS_WINDOWS) #define _USE_MATH_DEFINES @@ -520,6 +560,7 @@ static CYTHON_INLINE float __PYX_NAN() { #define __PYX_HAVE__pyndl__ndl_parallel #define __PYX_HAVE_API__pyndl__ndl_parallel +/* Early includes */ #include #include #include "numpy/arrayobject.h" @@ -804,7 +845,7 @@ typedef struct { #endif -/* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":743 +/* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":730 * # in Cython to enable them only on the right systems. * * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<< @@ -813,7 +854,7 @@ typedef struct { */ typedef npy_int8 __pyx_t_5numpy_int8_t; -/* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":744 +/* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":731 * * ctypedef npy_int8 int8_t * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<< @@ -822,7 +863,7 @@ typedef npy_int8 __pyx_t_5numpy_int8_t; */ typedef npy_int16 __pyx_t_5numpy_int16_t; -/* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":745 +/* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":732 * ctypedef npy_int8 int8_t * ctypedef npy_int16 int16_t * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<< @@ -831,7 +872,7 @@ typedef npy_int16 __pyx_t_5numpy_int16_t; */ typedef npy_int32 __pyx_t_5numpy_int32_t; -/* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":746 +/* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":733 * ctypedef npy_int16 int16_t * ctypedef npy_int32 int32_t * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<< @@ -840,7 +881,7 @@ typedef npy_int32 __pyx_t_5numpy_int32_t; */ typedef npy_int64 __pyx_t_5numpy_int64_t; -/* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":750 +/* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":737 * #ctypedef npy_int128 int128_t * * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<< @@ -849,7 +890,7 @@ typedef npy_int64 __pyx_t_5numpy_int64_t; */ typedef npy_uint8 __pyx_t_5numpy_uint8_t; -/* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":751 +/* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":738 * * ctypedef npy_uint8 uint8_t * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<< @@ -858,7 +899,7 @@ typedef npy_uint8 __pyx_t_5numpy_uint8_t; */ typedef npy_uint16 __pyx_t_5numpy_uint16_t; -/* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":752 +/* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":739 * ctypedef npy_uint8 uint8_t * ctypedef npy_uint16 uint16_t * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<< @@ -867,7 +908,7 @@ typedef npy_uint16 __pyx_t_5numpy_uint16_t; */ typedef npy_uint32 __pyx_t_5numpy_uint32_t; -/* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":753 +/* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":740 * ctypedef npy_uint16 uint16_t * ctypedef npy_uint32 uint32_t * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<< @@ -876,7 +917,7 @@ typedef npy_uint32 __pyx_t_5numpy_uint32_t; */ typedef npy_uint64 __pyx_t_5numpy_uint64_t; -/* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":757 +/* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":744 * #ctypedef npy_uint128 uint128_t * * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<< @@ -885,7 +926,7 @@ typedef npy_uint64 __pyx_t_5numpy_uint64_t; */ typedef npy_float32 __pyx_t_5numpy_float32_t; -/* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":758 +/* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":745 * * ctypedef npy_float32 float32_t * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<< @@ -894,7 +935,7 @@ typedef npy_float32 __pyx_t_5numpy_float32_t; */ typedef npy_float64 __pyx_t_5numpy_float64_t; -/* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":767 +/* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.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 # <<<<<<<<<<<<<< @@ -903,7 +944,7 @@ typedef npy_float64 __pyx_t_5numpy_float64_t; */ typedef npy_long __pyx_t_5numpy_int_t; -/* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":768 +/* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":755 * # numpy.int corresponds to 'l' and numpy.long to 'q' * ctypedef npy_long int_t * ctypedef npy_longlong long_t # <<<<<<<<<<<<<< @@ -912,7 +953,7 @@ typedef npy_long __pyx_t_5numpy_int_t; */ typedef npy_longlong __pyx_t_5numpy_long_t; -/* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":769 +/* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":756 * ctypedef npy_long int_t * ctypedef npy_longlong long_t * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<< @@ -921,7 +962,7 @@ typedef npy_longlong __pyx_t_5numpy_long_t; */ typedef npy_longlong __pyx_t_5numpy_longlong_t; -/* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":771 +/* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":758 * ctypedef npy_longlong longlong_t * * ctypedef npy_ulong uint_t # <<<<<<<<<<<<<< @@ -930,7 +971,7 @@ typedef npy_longlong __pyx_t_5numpy_longlong_t; */ typedef npy_ulong __pyx_t_5numpy_uint_t; -/* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":772 +/* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":759 * * ctypedef npy_ulong uint_t * ctypedef npy_ulonglong ulong_t # <<<<<<<<<<<<<< @@ -939,7 +980,7 @@ typedef npy_ulong __pyx_t_5numpy_uint_t; */ typedef npy_ulonglong __pyx_t_5numpy_ulong_t; -/* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":773 +/* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":760 * ctypedef npy_ulong uint_t * ctypedef npy_ulonglong ulong_t * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<< @@ -948,7 +989,7 @@ typedef npy_ulonglong __pyx_t_5numpy_ulong_t; */ typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t; -/* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":775 +/* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":762 * ctypedef npy_ulonglong ulonglong_t * * ctypedef npy_intp intp_t # <<<<<<<<<<<<<< @@ -957,7 +998,7 @@ typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t; */ typedef npy_intp __pyx_t_5numpy_intp_t; -/* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":776 +/* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":763 * * ctypedef npy_intp intp_t * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<< @@ -966,7 +1007,7 @@ typedef npy_intp __pyx_t_5numpy_intp_t; */ typedef npy_uintp __pyx_t_5numpy_uintp_t; -/* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":778 +/* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":765 * ctypedef npy_uintp uintp_t * * ctypedef npy_double float_t # <<<<<<<<<<<<<< @@ -975,7 +1016,7 @@ typedef npy_uintp __pyx_t_5numpy_uintp_t; */ typedef npy_double __pyx_t_5numpy_float_t; -/* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":779 +/* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":766 * * ctypedef npy_double float_t * ctypedef npy_double double_t # <<<<<<<<<<<<<< @@ -984,7 +1025,7 @@ typedef npy_double __pyx_t_5numpy_float_t; */ typedef npy_double __pyx_t_5numpy_double_t; -/* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":780 +/* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":767 * ctypedef npy_double float_t * ctypedef npy_double double_t * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<< @@ -1028,7 +1069,7 @@ static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(do /*--- Type declarations ---*/ -/* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":782 +/* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":769 * ctypedef npy_longdouble longdouble_t * * ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<< @@ -1037,7 +1078,7 @@ static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(do */ typedef npy_cfloat __pyx_t_5numpy_cfloat_t; -/* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":783 +/* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":770 * * ctypedef npy_cfloat cfloat_t * ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<< @@ -1046,7 +1087,7 @@ typedef npy_cfloat __pyx_t_5numpy_cfloat_t; */ typedef npy_cdouble __pyx_t_5numpy_cdouble_t; -/* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":784 +/* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":771 * ctypedef npy_cfloat cfloat_t * ctypedef npy_cdouble cdouble_t * ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<< @@ -1055,7 +1096,7 @@ typedef npy_cdouble __pyx_t_5numpy_cdouble_t; */ typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t; -/* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":786 +/* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":773 * ctypedef npy_clongdouble clongdouble_t * * ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<< @@ -1130,16 +1171,7 @@ typedef npy_cdouble __pyx_t_5numpy_complex_t; /* PyObjectGetAttrStr.proto */ #if CYTHON_USE_TYPE_SLOTS -static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { - PyTypeObject* tp = Py_TYPE(obj); - if (likely(tp->tp_getattro)) - return tp->tp_getattro(obj, attr_name); -#if PY_MAJOR_VERSION < 3 - if (likely(tp->tp_getattr)) - return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); -#endif - return PyObject_GetAttr(obj, attr_name); -} +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) #endif @@ -1193,6 +1225,32 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) #endif +/* PyCFunctionFastCall.proto */ +#if CYTHON_FAST_PYCCALL +static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs); +#else +#define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL) +#endif + +/* PyFunctionFastCall.proto */ +#if CYTHON_FAST_PYCALL +#define __Pyx_PyFunction_FastCall(func, args, nargs)\ + __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) +#if 1 || PY_VERSION_HEX < 0x030600B1 +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs); +#else +#define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs) +#endif +#endif + +/* PyObjectCallMethO.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); +#endif + +/* PyObjectCallOneArg.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); + /* PyThreadStateGet.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; @@ -1234,23 +1292,13 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject /* DictGetItem.proto */ #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY -static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) { - PyObject *value; - value = PyDict_GetItemWithError(d, key); - if (unlikely(!value)) { - if (!PyErr_Occurred()) { - PyObject* args = PyTuple_Pack(1, key); - if (likely(args)) - PyErr_SetObject(PyExc_KeyError, args); - Py_XDECREF(args); - } - return NULL; - } - Py_INCREF(value); - return value; -} +static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key); +#define __Pyx_PyObject_Dict_GetItem(obj, name)\ + (likely(PyDict_CheckExact(obj)) ?\ + __Pyx_PyDict_GetItem(obj, name) : PyObject_GetItem(obj, name)) #else - #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key) +#define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key) +#define __Pyx_PyObject_Dict_GetItem(obj, name) PyObject_GetItem(obj, name) #endif /* RaiseTooManyValuesToUnpack.proto */ @@ -1344,6 +1392,9 @@ typedef struct { #endif +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_PY_LONG_LONG(unsigned PY_LONG_LONG value); + /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); @@ -1474,6 +1525,7 @@ static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObj #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) #endif +#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) /* CheckBinaryVersion.proto */ static int __Pyx_check_binary_version(void); @@ -1534,6 +1586,10 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *, cha static unsigned int __pyx_v_5pyndl_12ndl_parallel_MAGIC_NUMBER; static unsigned int __pyx_v_5pyndl_12ndl_parallel_CURRENT_VERSION_WITH_FREQ; static unsigned int __pyx_v_5pyndl_12ndl_parallel_CURRENT_VERSION; +static unsigned PY_LONG_LONG __pyx_v_5pyndl_12ndl_parallel_test_index; +static unsigned int __pyx_v_5pyndl_12ndl_parallel_test_cue_index; +static unsigned int __pyx_v_5pyndl_12ndl_parallel_test_mm; +static unsigned int __pyx_v_5pyndl_12ndl_parallel_test_outcome_index; static CYTHON_INLINE void __pyx_f_5pyndl_12ndl_parallel_read_next_int(void *, FILE *); /*proto*/ static int __pyx_f_5pyndl_12ndl_parallel_is_element_of(unsigned int, unsigned int *, unsigned int); /*proto*/ static int __pyx_f_5pyndl_12ndl_parallel_learn_inplace_ptr(char *, __pyx_t_5pyndl_12ndl_parallel_dtype_t *, unsigned int, __pyx_t_5pyndl_12ndl_parallel_dtype_t, __pyx_t_5pyndl_12ndl_parallel_dtype_t, __pyx_t_5pyndl_12ndl_parallel_dtype_t, __pyx_t_5pyndl_12ndl_parallel_dtype_t, unsigned int *, unsigned int, unsigned int); /*proto*/ @@ -1649,6 +1705,7 @@ static PyObject *__pyx_pf_5pyndl_12ndl_parallel_learn_inplace(CYTHON_UNUSED PyOb static PyObject *__pyx_pf_5pyndl_12ndl_parallel_2learn_inplace_2(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_binary_file_paths, PyArrayObject *__pyx_v_weights, __pyx_t_5pyndl_12ndl_parallel_dtype_t __pyx_v_alpha, __pyx_t_5pyndl_12ndl_parallel_dtype_t __pyx_v_beta1, __pyx_t_5pyndl_12ndl_parallel_dtype_t __pyx_v_beta2, __pyx_t_5pyndl_12ndl_parallel_dtype_t __pyx_v_lambda_, PyArrayObject *__pyx_v_all_outcomes); /* proto */ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info); /* proto */ +static PyObject *__pyx_int_18446744069414584320; static PyObject *__pyx_tuple_; static PyObject *__pyx_tuple__2; static PyObject *__pyx_tuple__3; @@ -1664,8 +1721,9 @@ static PyObject *__pyx_tuple__12; static PyObject *__pyx_tuple__14; static PyObject *__pyx_codeobj__13; static PyObject *__pyx_codeobj__15; +/* Late includes */ -/* "pyndl/ndl_parallel.pyx":17 +/* "pyndl/ndl_parallel.pyx":30 * * * cdef inline void read_next_int(void *data, FILE *binary_file) nogil: # <<<<<<<<<<<<<< @@ -1675,16 +1733,16 @@ static PyObject *__pyx_codeobj__15; static CYTHON_INLINE void __pyx_f_5pyndl_12ndl_parallel_read_next_int(void *__pyx_v_data, FILE *__pyx_v_binary_file) { - /* "pyndl/ndl_parallel.pyx":18 + /* "pyndl/ndl_parallel.pyx":31 * * cdef inline void read_next_int(void *data, FILE *binary_file) nogil: * fread(data, 4, 1, binary_file) # little endian # <<<<<<<<<<<<<< * * */ - fread(__pyx_v_data, 4, 1, __pyx_v_binary_file); + (void)(fread(__pyx_v_data, 4, 1, __pyx_v_binary_file)); - /* "pyndl/ndl_parallel.pyx":17 + /* "pyndl/ndl_parallel.pyx":30 * * * cdef inline void read_next_int(void *data, FILE *binary_file) nogil: # <<<<<<<<<<<<<< @@ -1695,7 +1753,7 @@ static CYTHON_INLINE void __pyx_f_5pyndl_12ndl_parallel_read_next_int(void *__py /* function exit code */ } -/* "pyndl/ndl_parallel.pyx":30 +/* "pyndl/ndl_parallel.pyx":43 * * * def learn_inplace(binary_file_paths, np.ndarray[dtype_t, ndim=2] weights, # <<<<<<<<<<<<<< @@ -1750,59 +1808,59 @@ static PyObject *__pyx_pw_5pyndl_12ndl_parallel_1learn_inplace(PyObject *__pyx_s kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_binary_file_paths)) != 0)) kw_args--; + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_binary_file_paths)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_weights)) != 0)) kw_args--; + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_weights)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("learn_inplace", 1, 9, 9, 1); __PYX_ERR(0, 30, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("learn_inplace", 1, 9, 9, 1); __PYX_ERR(0, 43, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_alpha)) != 0)) kw_args--; + if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_alpha)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("learn_inplace", 1, 9, 9, 2); __PYX_ERR(0, 30, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("learn_inplace", 1, 9, 9, 2); __PYX_ERR(0, 43, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_beta1)) != 0)) kw_args--; + if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_beta1)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("learn_inplace", 1, 9, 9, 3); __PYX_ERR(0, 30, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("learn_inplace", 1, 9, 9, 3); __PYX_ERR(0, 43, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: - if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_beta2)) != 0)) kw_args--; + if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_beta2)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("learn_inplace", 1, 9, 9, 4); __PYX_ERR(0, 30, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("learn_inplace", 1, 9, 9, 4); __PYX_ERR(0, 43, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 5: - if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_lambda)) != 0)) kw_args--; + if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_lambda)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("learn_inplace", 1, 9, 9, 5); __PYX_ERR(0, 30, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("learn_inplace", 1, 9, 9, 5); __PYX_ERR(0, 43, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 6: - if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_all_outcomes)) != 0)) kw_args--; + if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_all_outcomes)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("learn_inplace", 1, 9, 9, 6); __PYX_ERR(0, 30, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("learn_inplace", 1, 9, 9, 6); __PYX_ERR(0, 43, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 7: - if (likely((values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_chunksize)) != 0)) kw_args--; + if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_chunksize)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("learn_inplace", 1, 9, 9, 7); __PYX_ERR(0, 30, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("learn_inplace", 1, 9, 9, 7); __PYX_ERR(0, 43, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 8: - if (likely((values[8] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_number_of_threads)) != 0)) kw_args--; + if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_number_of_threads)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("learn_inplace", 1, 9, 9, 8); __PYX_ERR(0, 30, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("learn_inplace", 1, 9, 9, 8); __PYX_ERR(0, 43, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "learn_inplace") < 0)) __PYX_ERR(0, 30, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "learn_inplace") < 0)) __PYX_ERR(0, 43, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 9) { goto __pyx_L5_argtuple_error; @@ -1819,24 +1877,24 @@ static PyObject *__pyx_pw_5pyndl_12ndl_parallel_1learn_inplace(PyObject *__pyx_s } __pyx_v_binary_file_paths = values[0]; __pyx_v_weights = ((PyArrayObject *)values[1]); - __pyx_v_alpha = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_alpha == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 31, __pyx_L3_error) - __pyx_v_beta1 = __pyx_PyFloat_AsDouble(values[3]); if (unlikely((__pyx_v_beta1 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 31, __pyx_L3_error) - __pyx_v_beta2 = __pyx_PyFloat_AsDouble(values[4]); if (unlikely((__pyx_v_beta2 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 32, __pyx_L3_error) - __pyx_v_lambda_ = __pyx_PyFloat_AsDouble(values[5]); if (unlikely((__pyx_v_lambda_ == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 32, __pyx_L3_error) + __pyx_v_alpha = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_alpha == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 44, __pyx_L3_error) + __pyx_v_beta1 = __pyx_PyFloat_AsDouble(values[3]); if (unlikely((__pyx_v_beta1 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 44, __pyx_L3_error) + __pyx_v_beta2 = __pyx_PyFloat_AsDouble(values[4]); if (unlikely((__pyx_v_beta2 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 45, __pyx_L3_error) + __pyx_v_lambda_ = __pyx_PyFloat_AsDouble(values[5]); if (unlikely((__pyx_v_lambda_ == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 45, __pyx_L3_error) __pyx_v_all_outcomes = ((PyArrayObject *)values[6]); - __pyx_v_chunksize = __Pyx_PyInt_As_unsigned_int(values[7]); if (unlikely((__pyx_v_chunksize == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 34, __pyx_L3_error) - __pyx_v_number_of_threads = __Pyx_PyInt_As_unsigned_int(values[8]); if (unlikely((__pyx_v_number_of_threads == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 35, __pyx_L3_error) + __pyx_v_chunksize = __Pyx_PyInt_As_unsigned_int(values[7]); if (unlikely((__pyx_v_chunksize == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 47, __pyx_L3_error) + __pyx_v_number_of_threads = __Pyx_PyInt_As_unsigned_int(values[8]); if (unlikely((__pyx_v_number_of_threads == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 48, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("learn_inplace", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 30, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("learn_inplace", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 43, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("pyndl.ndl_parallel.learn_inplace", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_weights), __pyx_ptype_5numpy_ndarray, 1, "weights", 0))) __PYX_ERR(0, 30, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_all_outcomes), __pyx_ptype_5numpy_ndarray, 1, "all_outcomes", 0))) __PYX_ERR(0, 33, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_weights), __pyx_ptype_5numpy_ndarray, 1, "weights", 0))) __PYX_ERR(0, 43, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_all_outcomes), __pyx_ptype_5numpy_ndarray, 1, "all_outcomes", 0))) __PYX_ERR(0, 46, __pyx_L1_error) __pyx_r = __pyx_pf_5pyndl_12ndl_parallel_learn_inplace(__pyx_self, __pyx_v_binary_file_paths, __pyx_v_weights, __pyx_v_alpha, __pyx_v_beta1, __pyx_v_beta2, __pyx_v_lambda_, __pyx_v_all_outcomes, __pyx_v_chunksize, __pyx_v_number_of_threads); /* function exit code */ @@ -1892,16 +1950,16 @@ static PyObject *__pyx_pf_5pyndl_12ndl_parallel_learn_inplace(CYTHON_UNUSED PyOb __pyx_pybuffernd_all_outcomes.rcbuffer = &__pyx_pybuffer_all_outcomes; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_weights.rcbuffer->pybuffer, (PyObject*)__pyx_v_weights, &__Pyx_TypeInfo_nn___pyx_t_5pyndl_12ndl_parallel_dtype_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 30, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_weights.rcbuffer->pybuffer, (PyObject*)__pyx_v_weights, &__Pyx_TypeInfo_nn___pyx_t_5pyndl_12ndl_parallel_dtype_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 43, __pyx_L1_error) } __pyx_pybuffernd_weights.diminfo[0].strides = __pyx_pybuffernd_weights.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_weights.diminfo[0].shape = __pyx_pybuffernd_weights.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_weights.diminfo[1].strides = __pyx_pybuffernd_weights.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_weights.diminfo[1].shape = __pyx_pybuffernd_weights.rcbuffer->pybuffer.shape[1]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_all_outcomes.rcbuffer->pybuffer, (PyObject*)__pyx_v_all_outcomes, &__Pyx_TypeInfo_unsigned_int, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 30, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_all_outcomes.rcbuffer->pybuffer, (PyObject*)__pyx_v_all_outcomes, &__Pyx_TypeInfo_unsigned_int, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 43, __pyx_L1_error) } __pyx_pybuffernd_all_outcomes.diminfo[0].strides = __pyx_pybuffernd_all_outcomes.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_all_outcomes.diminfo[0].shape = __pyx_pybuffernd_all_outcomes.rcbuffer->pybuffer.shape[0]; - /* "pyndl/ndl_parallel.pyx":37 + /* "pyndl/ndl_parallel.pyx":50 * unsigned int number_of_threads): * * cdef unsigned int mm = weights.shape[1] # number of cues == columns # <<<<<<<<<<<<<< @@ -1910,7 +1968,7 @@ static PyObject *__pyx_pf_5pyndl_12ndl_parallel_learn_inplace(CYTHON_UNUSED PyOb */ __pyx_v_mm = (__pyx_v_weights->dimensions[1]); - /* "pyndl/ndl_parallel.pyx":38 + /* "pyndl/ndl_parallel.pyx":51 * * cdef unsigned int mm = weights.shape[1] # number of cues == columns * cdef unsigned int* all_outcomes_ptr = all_outcomes.data # <<<<<<<<<<<<<< @@ -1919,7 +1977,7 @@ static PyObject *__pyx_pf_5pyndl_12ndl_parallel_learn_inplace(CYTHON_UNUSED PyOb */ __pyx_v_all_outcomes_ptr = ((unsigned int *)__pyx_v_all_outcomes->data); - /* "pyndl/ndl_parallel.pyx":39 + /* "pyndl/ndl_parallel.pyx":52 * cdef unsigned int mm = weights.shape[1] # number of cues == columns * cdef unsigned int* all_outcomes_ptr = all_outcomes.data * cdef unsigned int length_all_outcomes = all_outcomes.shape[0] # <<<<<<<<<<<<<< @@ -1928,7 +1986,7 @@ static PyObject *__pyx_pf_5pyndl_12ndl_parallel_learn_inplace(CYTHON_UNUSED PyOb */ __pyx_v_length_all_outcomes = (__pyx_v_all_outcomes->dimensions[0]); - /* "pyndl/ndl_parallel.pyx":42 + /* "pyndl/ndl_parallel.pyx":55 * cdef char* fname * cdef unsigned int start_val, end_val, ii, number_parts * cdef int error = 4 # <<<<<<<<<<<<<< @@ -1937,7 +1995,7 @@ static PyObject *__pyx_pf_5pyndl_12ndl_parallel_learn_inplace(CYTHON_UNUSED PyOb */ __pyx_v_error = 4; - /* "pyndl/ndl_parallel.pyx":47 + /* "pyndl/ndl_parallel.pyx":60 * # weights muss contigousarray sein und mode=c, siehe: * #cdef np.ndarray[np.uint32_t, ndim=3, mode = 'c'] np_buff = np.ascontiguousarray(im, dtype = np.uint32) * cdef dtype_t* weights_ptr = weights.data # ueberlegen ob [][] oder ** oder [] oder * # <<<<<<<<<<<<<< @@ -1946,7 +2004,7 @@ static PyObject *__pyx_pf_5pyndl_12ndl_parallel_learn_inplace(CYTHON_UNUSED PyOb */ __pyx_v_weights_ptr = ((__pyx_t_5pyndl_12ndl_parallel_dtype_t *)__pyx_v_weights->data); - /* "pyndl/ndl_parallel.pyx":49 + /* "pyndl/ndl_parallel.pyx":62 * cdef dtype_t* weights_ptr = weights.data # ueberlegen ob [][] oder ** oder [] oder * * * for binary_file_path in binary_file_paths: # # <<<<<<<<<<<<<< @@ -1957,26 +2015,26 @@ static PyObject *__pyx_pf_5pyndl_12ndl_parallel_learn_inplace(CYTHON_UNUSED PyOb __pyx_t_1 = __pyx_v_binary_file_paths; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; __pyx_t_3 = NULL; } else { - __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_binary_file_paths); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 49, __pyx_L1_error) + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_binary_file_paths); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 62, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 49, __pyx_L1_error) + __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 62, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { if (likely(PyList_CheckExact(__pyx_t_1))) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 49, __pyx_L1_error) + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 62, __pyx_L1_error) #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 49, __pyx_L1_error) + __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 62, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } else { if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 49, __pyx_L1_error) + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 62, __pyx_L1_error) #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 49, __pyx_L1_error) + __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 62, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } @@ -1986,7 +2044,7 @@ static PyObject *__pyx_pf_5pyndl_12ndl_parallel_learn_inplace(CYTHON_UNUSED PyOb PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 49, __pyx_L1_error) + else __PYX_ERR(0, 62, __pyx_L1_error) } break; } @@ -1995,32 +2053,32 @@ static PyObject *__pyx_pf_5pyndl_12ndl_parallel_learn_inplace(CYTHON_UNUSED PyOb __Pyx_XDECREF_SET(__pyx_v_binary_file_path, __pyx_t_4); __pyx_t_4 = 0; - /* "pyndl/ndl_parallel.pyx":50 + /* "pyndl/ndl_parallel.pyx":63 * * for binary_file_path in binary_file_paths: # * filename_byte_string = binary_file_path.encode("UTF-8") # <<<<<<<<<<<<<< * fname = filename_byte_string * */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_binary_file_path, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 50, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_binary_file_path, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 50, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF_SET(__pyx_v_filename_byte_string, __pyx_t_5); __pyx_t_5 = 0; - /* "pyndl/ndl_parallel.pyx":51 + /* "pyndl/ndl_parallel.pyx":64 * for binary_file_path in binary_file_paths: # * filename_byte_string = binary_file_path.encode("UTF-8") * fname = filename_byte_string # <<<<<<<<<<<<<< * * number_parts = (length_all_outcomes // chunksize) + 1 */ - __pyx_t_6 = __Pyx_PyObject_AsWritableString(__pyx_v_filename_byte_string); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 51, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_AsWritableString(__pyx_v_filename_byte_string); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 64, __pyx_L1_error) __pyx_v_fname = __pyx_t_6; - /* "pyndl/ndl_parallel.pyx":53 + /* "pyndl/ndl_parallel.pyx":66 * fname = filename_byte_string * * number_parts = (length_all_outcomes // chunksize) + 1 # <<<<<<<<<<<<<< @@ -2029,11 +2087,11 @@ static PyObject *__pyx_pf_5pyndl_12ndl_parallel_learn_inplace(CYTHON_UNUSED PyOb */ if (unlikely(__pyx_v_chunksize == 0)) { PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero"); - __PYX_ERR(0, 53, __pyx_L1_error) + __PYX_ERR(0, 66, __pyx_L1_error) } __pyx_v_number_parts = ((__pyx_v_length_all_outcomes / __pyx_v_chunksize) + 1); - /* "pyndl/ndl_parallel.pyx":55 + /* "pyndl/ndl_parallel.pyx":68 * number_parts = (length_all_outcomes // chunksize) + 1 * * with nogil, parallel(num_threads=number_of_threads): # <<<<<<<<<<<<<< @@ -2059,7 +2117,7 @@ static PyObject *__pyx_pf_5pyndl_12ndl_parallel_learn_inplace(CYTHON_UNUSED PyOb #endif /* _OPENMP */ { - /* "pyndl/ndl_parallel.pyx":56 + /* "pyndl/ndl_parallel.pyx":69 * * with nogil, parallel(num_threads=number_of_threads): * for ii in prange(number_parts, schedule="dynamic", chunksize=1): # <<<<<<<<<<<<<< @@ -2091,7 +2149,7 @@ static PyObject *__pyx_pf_5pyndl_12ndl_parallel_learn_inplace(CYTHON_UNUSED PyOb __pyx_v_error = ((int)0xbad0bad0); __pyx_v_start_val = ((unsigned int)0xbad0bad0); - /* "pyndl/ndl_parallel.pyx":57 + /* "pyndl/ndl_parallel.pyx":70 * with nogil, parallel(num_threads=number_of_threads): * for ii in prange(number_parts, schedule="dynamic", chunksize=1): * start_val = ii * chunksize # <<<<<<<<<<<<<< @@ -2100,7 +2158,7 @@ static PyObject *__pyx_pf_5pyndl_12ndl_parallel_learn_inplace(CYTHON_UNUSED PyOb */ __pyx_v_start_val = (__pyx_v_ii * __pyx_v_chunksize); - /* "pyndl/ndl_parallel.pyx":58 + /* "pyndl/ndl_parallel.pyx":71 * for ii in prange(number_parts, schedule="dynamic", chunksize=1): * start_val = ii * chunksize * end_val = min(start_val + chunksize, length_all_outcomes) # <<<<<<<<<<<<<< @@ -2116,7 +2174,7 @@ static PyObject *__pyx_pf_5pyndl_12ndl_parallel_learn_inplace(CYTHON_UNUSED PyOb } __pyx_v_end_val = __pyx_t_13; - /* "pyndl/ndl_parallel.pyx":59 + /* "pyndl/ndl_parallel.pyx":72 * start_val = ii * chunksize * end_val = min(start_val + chunksize, length_all_outcomes) * if start_val == length_all_outcomes: # <<<<<<<<<<<<<< @@ -2126,7 +2184,7 @@ static PyObject *__pyx_pf_5pyndl_12ndl_parallel_learn_inplace(CYTHON_UNUSED PyOb __pyx_t_14 = ((__pyx_v_start_val == __pyx_v_length_all_outcomes) != 0); if (__pyx_t_14) { - /* "pyndl/ndl_parallel.pyx":60 + /* "pyndl/ndl_parallel.pyx":73 * end_val = min(start_val + chunksize, length_all_outcomes) * if start_val == length_all_outcomes: * break # <<<<<<<<<<<<<< @@ -2135,7 +2193,7 @@ static PyObject *__pyx_pf_5pyndl_12ndl_parallel_learn_inplace(CYTHON_UNUSED PyOb */ goto __pyx_L15_break; - /* "pyndl/ndl_parallel.pyx":59 + /* "pyndl/ndl_parallel.pyx":72 * start_val = ii * chunksize * end_val = min(start_val + chunksize, length_all_outcomes) * if start_val == length_all_outcomes: # <<<<<<<<<<<<<< @@ -2144,7 +2202,7 @@ static PyObject *__pyx_pf_5pyndl_12ndl_parallel_learn_inplace(CYTHON_UNUSED PyOb */ } - /* "pyndl/ndl_parallel.pyx":61 + /* "pyndl/ndl_parallel.pyx":74 * if start_val == length_all_outcomes: * break * error = 0 # <<<<<<<<<<<<<< @@ -2153,7 +2211,7 @@ static PyObject *__pyx_pf_5pyndl_12ndl_parallel_learn_inplace(CYTHON_UNUSED PyOb */ __pyx_v_error = 0; - /* "pyndl/ndl_parallel.pyx":62 + /* "pyndl/ndl_parallel.pyx":75 * break * error = 0 * error = learn_inplace_ptr(fname, weights_ptr, mm, alpha, beta1, # <<<<<<<<<<<<<< @@ -2201,7 +2259,7 @@ static PyObject *__pyx_pf_5pyndl_12ndl_parallel_learn_inplace(CYTHON_UNUSED PyOb #endif } - /* "pyndl/ndl_parallel.pyx":55 + /* "pyndl/ndl_parallel.pyx":68 * number_parts = (length_all_outcomes // chunksize) + 1 * * with nogil, parallel(num_threads=number_of_threads): # <<<<<<<<<<<<<< @@ -2220,7 +2278,7 @@ static PyObject *__pyx_pf_5pyndl_12ndl_parallel_learn_inplace(CYTHON_UNUSED PyOb } } - /* "pyndl/ndl_parallel.pyx":49 + /* "pyndl/ndl_parallel.pyx":62 * cdef dtype_t* weights_ptr = weights.data # ueberlegen ob [][] oder ** oder [] oder * * * for binary_file_path in binary_file_paths: # # <<<<<<<<<<<<<< @@ -2230,7 +2288,7 @@ static PyObject *__pyx_pf_5pyndl_12ndl_parallel_learn_inplace(CYTHON_UNUSED PyOb } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "pyndl/ndl_parallel.pyx":65 + /* "pyndl/ndl_parallel.pyx":78 * beta2, lambda_, all_outcomes_ptr, start_val, * end_val) * if (error != 0): # <<<<<<<<<<<<<< @@ -2238,33 +2296,28 @@ static PyObject *__pyx_pf_5pyndl_12ndl_parallel_learn_inplace(CYTHON_UNUSED PyOb * */ __pyx_t_14 = ((__pyx_v_error != 0) != 0); - if (__pyx_t_14) { + if (unlikely(__pyx_t_14)) { - /* "pyndl/ndl_parallel.pyx":66 + /* "pyndl/ndl_parallel.pyx":79 * end_val) * if (error != 0): * raise IOError('binary files does not have proper format, error code %i' % error) # <<<<<<<<<<<<<< * * def learn_inplace_2(binary_file_paths, np.ndarray[dtype_t, ndim=2] weights, */ - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 66, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 79, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_binary_files_does_not_have_prope, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 66, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_binary_files_does_not_have_prope, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 79, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 66, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IOError, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 79, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_GIVEREF(__pyx_t_5); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5); - __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 66, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __PYX_ERR(0, 66, __pyx_L1_error) + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 79, __pyx_L1_error) - /* "pyndl/ndl_parallel.pyx":65 + /* "pyndl/ndl_parallel.pyx":78 * beta2, lambda_, all_outcomes_ptr, start_val, * end_val) * if (error != 0): # <<<<<<<<<<<<<< @@ -2273,7 +2326,7 @@ static PyObject *__pyx_pf_5pyndl_12ndl_parallel_learn_inplace(CYTHON_UNUSED PyOb */ } - /* "pyndl/ndl_parallel.pyx":30 + /* "pyndl/ndl_parallel.pyx":43 * * * def learn_inplace(binary_file_paths, np.ndarray[dtype_t, ndim=2] weights, # <<<<<<<<<<<<<< @@ -2309,7 +2362,7 @@ static PyObject *__pyx_pf_5pyndl_12ndl_parallel_learn_inplace(CYTHON_UNUSED PyOb return __pyx_r; } -/* "pyndl/ndl_parallel.pyx":68 +/* "pyndl/ndl_parallel.pyx":81 * raise IOError('binary files does not have proper format, error code %i' % error) * * def learn_inplace_2(binary_file_paths, np.ndarray[dtype_t, ndim=2] weights, # <<<<<<<<<<<<<< @@ -2358,47 +2411,47 @@ static PyObject *__pyx_pw_5pyndl_12ndl_parallel_3learn_inplace_2(PyObject *__pyx kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_binary_file_paths)) != 0)) kw_args--; + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_binary_file_paths)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_weights)) != 0)) kw_args--; + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_weights)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("learn_inplace_2", 1, 7, 7, 1); __PYX_ERR(0, 68, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("learn_inplace_2", 1, 7, 7, 1); __PYX_ERR(0, 81, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_alpha)) != 0)) kw_args--; + if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_alpha)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("learn_inplace_2", 1, 7, 7, 2); __PYX_ERR(0, 68, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("learn_inplace_2", 1, 7, 7, 2); __PYX_ERR(0, 81, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_beta1)) != 0)) kw_args--; + if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_beta1)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("learn_inplace_2", 1, 7, 7, 3); __PYX_ERR(0, 68, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("learn_inplace_2", 1, 7, 7, 3); __PYX_ERR(0, 81, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: - if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_beta2)) != 0)) kw_args--; + if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_beta2)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("learn_inplace_2", 1, 7, 7, 4); __PYX_ERR(0, 68, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("learn_inplace_2", 1, 7, 7, 4); __PYX_ERR(0, 81, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 5: - if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_lambda)) != 0)) kw_args--; + if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_lambda)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("learn_inplace_2", 1, 7, 7, 5); __PYX_ERR(0, 68, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("learn_inplace_2", 1, 7, 7, 5); __PYX_ERR(0, 81, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 6: - if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_all_outcomes)) != 0)) kw_args--; + if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_all_outcomes)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("learn_inplace_2", 1, 7, 7, 6); __PYX_ERR(0, 68, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("learn_inplace_2", 1, 7, 7, 6); __PYX_ERR(0, 81, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "learn_inplace_2") < 0)) __PYX_ERR(0, 68, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "learn_inplace_2") < 0)) __PYX_ERR(0, 81, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 7) { goto __pyx_L5_argtuple_error; @@ -2413,22 +2466,22 @@ static PyObject *__pyx_pw_5pyndl_12ndl_parallel_3learn_inplace_2(PyObject *__pyx } __pyx_v_binary_file_paths = values[0]; __pyx_v_weights = ((PyArrayObject *)values[1]); - __pyx_v_alpha = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_alpha == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 69, __pyx_L3_error) - __pyx_v_beta1 = __pyx_PyFloat_AsDouble(values[3]); if (unlikely((__pyx_v_beta1 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 69, __pyx_L3_error) - __pyx_v_beta2 = __pyx_PyFloat_AsDouble(values[4]); if (unlikely((__pyx_v_beta2 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 70, __pyx_L3_error) - __pyx_v_lambda_ = __pyx_PyFloat_AsDouble(values[5]); if (unlikely((__pyx_v_lambda_ == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 70, __pyx_L3_error) + __pyx_v_alpha = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_alpha == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 82, __pyx_L3_error) + __pyx_v_beta1 = __pyx_PyFloat_AsDouble(values[3]); if (unlikely((__pyx_v_beta1 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 82, __pyx_L3_error) + __pyx_v_beta2 = __pyx_PyFloat_AsDouble(values[4]); if (unlikely((__pyx_v_beta2 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 83, __pyx_L3_error) + __pyx_v_lambda_ = __pyx_PyFloat_AsDouble(values[5]); if (unlikely((__pyx_v_lambda_ == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 83, __pyx_L3_error) __pyx_v_all_outcomes = ((PyArrayObject *)values[6]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("learn_inplace_2", 1, 7, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 68, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("learn_inplace_2", 1, 7, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 81, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("pyndl.ndl_parallel.learn_inplace_2", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_weights), __pyx_ptype_5numpy_ndarray, 1, "weights", 0))) __PYX_ERR(0, 68, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_all_outcomes), __pyx_ptype_5numpy_ndarray, 1, "all_outcomes", 0))) __PYX_ERR(0, 71, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_weights), __pyx_ptype_5numpy_ndarray, 1, "weights", 0))) __PYX_ERR(0, 81, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_all_outcomes), __pyx_ptype_5numpy_ndarray, 1, "all_outcomes", 0))) __PYX_ERR(0, 84, __pyx_L1_error) __pyx_r = __pyx_pf_5pyndl_12ndl_parallel_2learn_inplace_2(__pyx_self, __pyx_v_binary_file_paths, __pyx_v_weights, __pyx_v_alpha, __pyx_v_beta1, __pyx_v_beta2, __pyx_v_lambda_, __pyx_v_all_outcomes); /* function exit code */ @@ -2473,16 +2526,16 @@ static PyObject *__pyx_pf_5pyndl_12ndl_parallel_2learn_inplace_2(CYTHON_UNUSED P __pyx_pybuffernd_all_outcomes.rcbuffer = &__pyx_pybuffer_all_outcomes; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_weights.rcbuffer->pybuffer, (PyObject*)__pyx_v_weights, &__Pyx_TypeInfo_nn___pyx_t_5pyndl_12ndl_parallel_dtype_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 68, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_weights.rcbuffer->pybuffer, (PyObject*)__pyx_v_weights, &__Pyx_TypeInfo_nn___pyx_t_5pyndl_12ndl_parallel_dtype_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 81, __pyx_L1_error) } __pyx_pybuffernd_weights.diminfo[0].strides = __pyx_pybuffernd_weights.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_weights.diminfo[0].shape = __pyx_pybuffernd_weights.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_weights.diminfo[1].strides = __pyx_pybuffernd_weights.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_weights.diminfo[1].shape = __pyx_pybuffernd_weights.rcbuffer->pybuffer.shape[1]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_all_outcomes.rcbuffer->pybuffer, (PyObject*)__pyx_v_all_outcomes, &__Pyx_TypeInfo_unsigned_int, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 68, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_all_outcomes.rcbuffer->pybuffer, (PyObject*)__pyx_v_all_outcomes, &__Pyx_TypeInfo_unsigned_int, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 81, __pyx_L1_error) } __pyx_pybuffernd_all_outcomes.diminfo[0].strides = __pyx_pybuffernd_all_outcomes.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_all_outcomes.diminfo[0].shape = __pyx_pybuffernd_all_outcomes.rcbuffer->pybuffer.shape[0]; - /* "pyndl/ndl_parallel.pyx":73 + /* "pyndl/ndl_parallel.pyx":86 * np.ndarray[unsigned int, ndim=1] all_outcomes): * * cdef unsigned int mm = weights.shape[1] # number of cues == columns # <<<<<<<<<<<<<< @@ -2491,7 +2544,7 @@ static PyObject *__pyx_pf_5pyndl_12ndl_parallel_2learn_inplace_2(CYTHON_UNUSED P */ __pyx_v_mm = (__pyx_v_weights->dimensions[1]); - /* "pyndl/ndl_parallel.pyx":74 + /* "pyndl/ndl_parallel.pyx":87 * * cdef unsigned int mm = weights.shape[1] # number of cues == columns * cdef unsigned int* all_outcomes_ptr = all_outcomes.data # <<<<<<<<<<<<<< @@ -2500,7 +2553,7 @@ static PyObject *__pyx_pf_5pyndl_12ndl_parallel_2learn_inplace_2(CYTHON_UNUSED P */ __pyx_v_all_outcomes_ptr = ((unsigned int *)__pyx_v_all_outcomes->data); - /* "pyndl/ndl_parallel.pyx":75 + /* "pyndl/ndl_parallel.pyx":88 * cdef unsigned int mm = weights.shape[1] # number of cues == columns * cdef unsigned int* all_outcomes_ptr = all_outcomes.data * cdef unsigned int length_all_outcomes = all_outcomes.shape[0] # <<<<<<<<<<<<<< @@ -2509,7 +2562,7 @@ static PyObject *__pyx_pf_5pyndl_12ndl_parallel_2learn_inplace_2(CYTHON_UNUSED P */ __pyx_v_length_all_outcomes = (__pyx_v_all_outcomes->dimensions[0]); - /* "pyndl/ndl_parallel.pyx":78 + /* "pyndl/ndl_parallel.pyx":91 * cdef char* fname * cdef unsigned int start_val, end_val * cdef int error = 4 # <<<<<<<<<<<<<< @@ -2518,7 +2571,7 @@ static PyObject *__pyx_pf_5pyndl_12ndl_parallel_2learn_inplace_2(CYTHON_UNUSED P */ __pyx_v_error = 4; - /* "pyndl/ndl_parallel.pyx":83 + /* "pyndl/ndl_parallel.pyx":96 * # weights muss contigousarray sein und mode=c, siehe: * #cdef np.ndarray[np.uint32_t, ndim=3, mode = 'c'] np_buff = np.ascontiguousarray(im, dtype = np.uint32) * cdef dtype_t* weights_ptr = weights.data # ueberlegen ob [][] oder ** oder [] oder * # <<<<<<<<<<<<<< @@ -2527,7 +2580,7 @@ static PyObject *__pyx_pf_5pyndl_12ndl_parallel_2learn_inplace_2(CYTHON_UNUSED P */ __pyx_v_weights_ptr = ((__pyx_t_5pyndl_12ndl_parallel_dtype_t *)__pyx_v_weights->data); - /* "pyndl/ndl_parallel.pyx":85 + /* "pyndl/ndl_parallel.pyx":98 * cdef dtype_t* weights_ptr = weights.data # ueberlegen ob [][] oder ** oder [] oder * * * for binary_file_path in binary_file_paths: # # <<<<<<<<<<<<<< @@ -2538,26 +2591,26 @@ static PyObject *__pyx_pf_5pyndl_12ndl_parallel_2learn_inplace_2(CYTHON_UNUSED P __pyx_t_1 = __pyx_v_binary_file_paths; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; __pyx_t_3 = NULL; } else { - __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_binary_file_paths); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 85, __pyx_L1_error) + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_binary_file_paths); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 98, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 85, __pyx_L1_error) + __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 98, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { if (likely(PyList_CheckExact(__pyx_t_1))) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 85, __pyx_L1_error) + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 98, __pyx_L1_error) #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 85, __pyx_L1_error) + __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 98, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } else { if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 85, __pyx_L1_error) + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 98, __pyx_L1_error) #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 85, __pyx_L1_error) + __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 98, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } @@ -2567,7 +2620,7 @@ static PyObject *__pyx_pf_5pyndl_12ndl_parallel_2learn_inplace_2(CYTHON_UNUSED P PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 85, __pyx_L1_error) + else __PYX_ERR(0, 98, __pyx_L1_error) } break; } @@ -2576,32 +2629,32 @@ static PyObject *__pyx_pf_5pyndl_12ndl_parallel_2learn_inplace_2(CYTHON_UNUSED P __Pyx_XDECREF_SET(__pyx_v_binary_file_path, __pyx_t_4); __pyx_t_4 = 0; - /* "pyndl/ndl_parallel.pyx":86 + /* "pyndl/ndl_parallel.pyx":99 * * for binary_file_path in binary_file_paths: # * filename_byte_string = binary_file_path.encode("UTF-8") # <<<<<<<<<<<<<< * fname = filename_byte_string * */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_binary_file_path, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 86, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_binary_file_path, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 99, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 86, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 99, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF_SET(__pyx_v_filename_byte_string, __pyx_t_5); __pyx_t_5 = 0; - /* "pyndl/ndl_parallel.pyx":87 + /* "pyndl/ndl_parallel.pyx":100 * for binary_file_path in binary_file_paths: # * filename_byte_string = binary_file_path.encode("UTF-8") * fname = filename_byte_string # <<<<<<<<<<<<<< * * with nogil: */ - __pyx_t_6 = __Pyx_PyObject_AsWritableString(__pyx_v_filename_byte_string); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 87, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_AsWritableString(__pyx_v_filename_byte_string); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 100, __pyx_L1_error) __pyx_v_fname = __pyx_t_6; - /* "pyndl/ndl_parallel.pyx":89 + /* "pyndl/ndl_parallel.pyx":102 * fname = filename_byte_string * * with nogil: # <<<<<<<<<<<<<< @@ -2616,7 +2669,7 @@ static PyObject *__pyx_pf_5pyndl_12ndl_parallel_2learn_inplace_2(CYTHON_UNUSED P #endif /*try:*/ { - /* "pyndl/ndl_parallel.pyx":90 + /* "pyndl/ndl_parallel.pyx":103 * * with nogil: * error = 0 # <<<<<<<<<<<<<< @@ -2625,7 +2678,7 @@ static PyObject *__pyx_pf_5pyndl_12ndl_parallel_2learn_inplace_2(CYTHON_UNUSED P */ __pyx_v_error = 0; - /* "pyndl/ndl_parallel.pyx":91 + /* "pyndl/ndl_parallel.pyx":104 * with nogil: * error = 0 * error = learn_inplace_ptr(fname, weights_ptr, mm, alpha, beta1, # <<<<<<<<<<<<<< @@ -2635,7 +2688,7 @@ static PyObject *__pyx_pf_5pyndl_12ndl_parallel_2learn_inplace_2(CYTHON_UNUSED P __pyx_v_error = __pyx_f_5pyndl_12ndl_parallel_learn_inplace_ptr(__pyx_v_fname, __pyx_v_weights_ptr, __pyx_v_mm, __pyx_v_alpha, __pyx_v_beta1, __pyx_v_beta2, __pyx_v_lambda_, __pyx_v_all_outcomes_ptr, 0, __pyx_v_length_all_outcomes); } - /* "pyndl/ndl_parallel.pyx":89 + /* "pyndl/ndl_parallel.pyx":102 * fname = filename_byte_string * * with nogil: # <<<<<<<<<<<<<< @@ -2654,7 +2707,7 @@ static PyObject *__pyx_pf_5pyndl_12ndl_parallel_2learn_inplace_2(CYTHON_UNUSED P } } - /* "pyndl/ndl_parallel.pyx":85 + /* "pyndl/ndl_parallel.pyx":98 * cdef dtype_t* weights_ptr = weights.data # ueberlegen ob [][] oder ** oder [] oder * * * for binary_file_path in binary_file_paths: # # <<<<<<<<<<<<<< @@ -2664,7 +2717,7 @@ static PyObject *__pyx_pf_5pyndl_12ndl_parallel_2learn_inplace_2(CYTHON_UNUSED P } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "pyndl/ndl_parallel.pyx":94 + /* "pyndl/ndl_parallel.pyx":107 * beta2, lambda_, all_outcomes_ptr, 0, * length_all_outcomes) * if (error != 0): # <<<<<<<<<<<<<< @@ -2672,33 +2725,28 @@ static PyObject *__pyx_pf_5pyndl_12ndl_parallel_2learn_inplace_2(CYTHON_UNUSED P * */ __pyx_t_7 = ((__pyx_v_error != 0) != 0); - if (__pyx_t_7) { + if (unlikely(__pyx_t_7)) { - /* "pyndl/ndl_parallel.pyx":95 + /* "pyndl/ndl_parallel.pyx":108 * length_all_outcomes) * if (error != 0): * raise IOError('binary files does not have proper format, error code %i' % error) # <<<<<<<<<<<<<< * * */ - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 95, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 108, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_binary_files_does_not_have_prope, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 95, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_binary_files_does_not_have_prope, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 108, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 95, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IOError, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 108, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_GIVEREF(__pyx_t_5); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5); - __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 95, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __PYX_ERR(0, 95, __pyx_L1_error) + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 108, __pyx_L1_error) - /* "pyndl/ndl_parallel.pyx":94 + /* "pyndl/ndl_parallel.pyx":107 * beta2, lambda_, all_outcomes_ptr, 0, * length_all_outcomes) * if (error != 0): # <<<<<<<<<<<<<< @@ -2707,7 +2755,7 @@ static PyObject *__pyx_pf_5pyndl_12ndl_parallel_2learn_inplace_2(CYTHON_UNUSED P */ } - /* "pyndl/ndl_parallel.pyx":68 + /* "pyndl/ndl_parallel.pyx":81 * raise IOError('binary files does not have proper format, error code %i' % error) * * def learn_inplace_2(binary_file_paths, np.ndarray[dtype_t, ndim=2] weights, # <<<<<<<<<<<<<< @@ -2743,7 +2791,7 @@ static PyObject *__pyx_pf_5pyndl_12ndl_parallel_2learn_inplace_2(CYTHON_UNUSED P return __pyx_r; } -/* "pyndl/ndl_parallel.pyx":98 +/* "pyndl/ndl_parallel.pyx":111 * * * cdef int is_element_of(unsigned int elem, unsigned int* arr, unsigned int size) nogil: # <<<<<<<<<<<<<< @@ -2756,9 +2804,10 @@ static int __pyx_f_5pyndl_12ndl_parallel_is_element_of(unsigned int __pyx_v_elem int __pyx_r; unsigned int __pyx_t_1; unsigned int __pyx_t_2; - int __pyx_t_3; + unsigned int __pyx_t_3; + int __pyx_t_4; - /* "pyndl/ndl_parallel.pyx":100 + /* "pyndl/ndl_parallel.pyx":113 * cdef int is_element_of(unsigned int elem, unsigned int* arr, unsigned int size) nogil: * cdef unsigned int ii * for ii in range(size): # <<<<<<<<<<<<<< @@ -2766,20 +2815,21 @@ static int __pyx_f_5pyndl_12ndl_parallel_is_element_of(unsigned int __pyx_v_elem * return True */ __pyx_t_1 = __pyx_v_size; - for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { - __pyx_v_ii = __pyx_t_2; + __pyx_t_2 = __pyx_t_1; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { + __pyx_v_ii = __pyx_t_3; - /* "pyndl/ndl_parallel.pyx":101 + /* "pyndl/ndl_parallel.pyx":114 * cdef unsigned int ii * for ii in range(size): * if arr[ii] == elem: # <<<<<<<<<<<<<< * return True * return False */ - __pyx_t_3 = (((__pyx_v_arr[__pyx_v_ii]) == __pyx_v_elem) != 0); - if (__pyx_t_3) { + __pyx_t_4 = (((__pyx_v_arr[__pyx_v_ii]) == __pyx_v_elem) != 0); + if (__pyx_t_4) { - /* "pyndl/ndl_parallel.pyx":102 + /* "pyndl/ndl_parallel.pyx":115 * for ii in range(size): * if arr[ii] == elem: * return True # <<<<<<<<<<<<<< @@ -2789,7 +2839,7 @@ static int __pyx_f_5pyndl_12ndl_parallel_is_element_of(unsigned int __pyx_v_elem __pyx_r = 1; goto __pyx_L0; - /* "pyndl/ndl_parallel.pyx":101 + /* "pyndl/ndl_parallel.pyx":114 * cdef unsigned int ii * for ii in range(size): * if arr[ii] == elem: # <<<<<<<<<<<<<< @@ -2799,7 +2849,7 @@ static int __pyx_f_5pyndl_12ndl_parallel_is_element_of(unsigned int __pyx_v_elem } } - /* "pyndl/ndl_parallel.pyx":103 + /* "pyndl/ndl_parallel.pyx":116 * if arr[ii] == elem: * return True * return False # <<<<<<<<<<<<<< @@ -2809,7 +2859,7 @@ static int __pyx_f_5pyndl_12ndl_parallel_is_element_of(unsigned int __pyx_v_elem __pyx_r = 0; goto __pyx_L0; - /* "pyndl/ndl_parallel.pyx":98 + /* "pyndl/ndl_parallel.pyx":111 * * * cdef int is_element_of(unsigned int elem, unsigned int* arr, unsigned int size) nogil: # <<<<<<<<<<<<<< @@ -2822,7 +2872,7 @@ static int __pyx_f_5pyndl_12ndl_parallel_is_element_of(unsigned int __pyx_v_elem return __pyx_r; } -/* "pyndl/ndl_parallel.pyx":107 +/* "pyndl/ndl_parallel.pyx":120 * * # ggf exception zurckgeben * cdef int learn_inplace_ptr(char* binary_file_path, dtype_t* weights, # <<<<<<<<<<<<<< @@ -2841,7 +2891,7 @@ static int __pyx_f_5pyndl_12ndl_parallel_learn_inplace_ptr(char *__pyx_v_binary_ unsigned int __pyx_v_ii; unsigned int __pyx_v_jj; CYTHON_UNUSED unsigned int __pyx_v_event; - unsigned int __pyx_v_index; + unsigned PY_LONG_LONG __pyx_v_index; unsigned int *__pyx_v_cue_indices; unsigned int *__pyx_v_outcome_indices; unsigned int __pyx_v_max_number_of_cues; @@ -2856,8 +2906,11 @@ static int __pyx_f_5pyndl_12ndl_parallel_learn_inplace_ptr(char *__pyx_v_binary_ unsigned int __pyx_t_6; unsigned int __pyx_t_7; unsigned int __pyx_t_8; + unsigned int __pyx_t_9; + unsigned int __pyx_t_10; + unsigned PY_LONG_LONG __pyx_t_11; - /* "pyndl/ndl_parallel.pyx":121 + /* "pyndl/ndl_parallel.pyx":135 * cdef unsigned int* cue_indices * cdef unsigned int* outcome_indices * cdef unsigned int max_number_of_cues = 1024 # <<<<<<<<<<<<<< @@ -2866,7 +2919,7 @@ static int __pyx_f_5pyndl_12ndl_parallel_learn_inplace_ptr(char *__pyx_v_binary_ */ __pyx_v_max_number_of_cues = 0x400; - /* "pyndl/ndl_parallel.pyx":122 + /* "pyndl/ndl_parallel.pyx":136 * cdef unsigned int* outcome_indices * cdef unsigned int max_number_of_cues = 1024 * cdef unsigned int max_number_of_outcomes = 1024 # <<<<<<<<<<<<<< @@ -2875,7 +2928,7 @@ static int __pyx_f_5pyndl_12ndl_parallel_learn_inplace_ptr(char *__pyx_v_binary_ */ __pyx_v_max_number_of_outcomes = 0x400; - /* "pyndl/ndl_parallel.pyx":125 + /* "pyndl/ndl_parallel.pyx":139 * * cdef FILE* binary_file * binary_file = fopen(binary_file_path, "rb") # <<<<<<<<<<<<<< @@ -2884,7 +2937,7 @@ static int __pyx_f_5pyndl_12ndl_parallel_learn_inplace_ptr(char *__pyx_v_binary_ */ __pyx_v_binary_file = fopen(__pyx_v_binary_file_path, ((char const *)"rb")); - /* "pyndl/ndl_parallel.pyx":127 + /* "pyndl/ndl_parallel.pyx":141 * binary_file = fopen(binary_file_path, "rb") * * read_next_int(&magic_number, binary_file) # <<<<<<<<<<<<<< @@ -2893,7 +2946,7 @@ static int __pyx_f_5pyndl_12ndl_parallel_learn_inplace_ptr(char *__pyx_v_binary_ */ __pyx_f_5pyndl_12ndl_parallel_read_next_int((&__pyx_v_magic_number), __pyx_v_binary_file); - /* "pyndl/ndl_parallel.pyx":128 + /* "pyndl/ndl_parallel.pyx":142 * * read_next_int(&magic_number, binary_file) * if not magic_number == MAGIC_NUMBER: # <<<<<<<<<<<<<< @@ -2903,16 +2956,16 @@ static int __pyx_f_5pyndl_12ndl_parallel_learn_inplace_ptr(char *__pyx_v_binary_ __pyx_t_1 = ((!((__pyx_v_magic_number == __pyx_v_5pyndl_12ndl_parallel_MAGIC_NUMBER) != 0)) != 0); if (__pyx_t_1) { - /* "pyndl/ndl_parallel.pyx":129 + /* "pyndl/ndl_parallel.pyx":143 * read_next_int(&magic_number, binary_file) * if not magic_number == MAGIC_NUMBER: * fclose(binary_file) # <<<<<<<<<<<<<< * return 1 * read_next_int(&version, binary_file) */ - fclose(__pyx_v_binary_file); + (void)(fclose(__pyx_v_binary_file)); - /* "pyndl/ndl_parallel.pyx":130 + /* "pyndl/ndl_parallel.pyx":144 * if not magic_number == MAGIC_NUMBER: * fclose(binary_file) * return 1 # <<<<<<<<<<<<<< @@ -2922,7 +2975,7 @@ static int __pyx_f_5pyndl_12ndl_parallel_learn_inplace_ptr(char *__pyx_v_binary_ __pyx_r = 1; goto __pyx_L0; - /* "pyndl/ndl_parallel.pyx":128 + /* "pyndl/ndl_parallel.pyx":142 * * read_next_int(&magic_number, binary_file) * if not magic_number == MAGIC_NUMBER: # <<<<<<<<<<<<<< @@ -2931,7 +2984,7 @@ static int __pyx_f_5pyndl_12ndl_parallel_learn_inplace_ptr(char *__pyx_v_binary_ */ } - /* "pyndl/ndl_parallel.pyx":131 + /* "pyndl/ndl_parallel.pyx":145 * fclose(binary_file) * return 1 * read_next_int(&version, binary_file) # <<<<<<<<<<<<<< @@ -2940,7 +2993,7 @@ static int __pyx_f_5pyndl_12ndl_parallel_learn_inplace_ptr(char *__pyx_v_binary_ */ __pyx_f_5pyndl_12ndl_parallel_read_next_int((&__pyx_v_version), __pyx_v_binary_file); - /* "pyndl/ndl_parallel.pyx":132 + /* "pyndl/ndl_parallel.pyx":146 * return 1 * read_next_int(&version, binary_file) * if version == CURRENT_VERSION: # <<<<<<<<<<<<<< @@ -2952,7 +3005,7 @@ static int __pyx_f_5pyndl_12ndl_parallel_learn_inplace_ptr(char *__pyx_v_binary_ goto __pyx_L4; } - /* "pyndl/ndl_parallel.pyx":135 + /* "pyndl/ndl_parallel.pyx":149 * pass * else: * fclose(binary_file) # <<<<<<<<<<<<<< @@ -2960,9 +3013,9 @@ static int __pyx_f_5pyndl_12ndl_parallel_learn_inplace_ptr(char *__pyx_v_binary_ * */ /*else*/ { - fclose(__pyx_v_binary_file); + (void)(fclose(__pyx_v_binary_file)); - /* "pyndl/ndl_parallel.pyx":136 + /* "pyndl/ndl_parallel.pyx":150 * else: * fclose(binary_file) * return 2 # <<<<<<<<<<<<<< @@ -2974,7 +3027,7 @@ static int __pyx_f_5pyndl_12ndl_parallel_learn_inplace_ptr(char *__pyx_v_binary_ } __pyx_L4:; - /* "pyndl/ndl_parallel.pyx":139 + /* "pyndl/ndl_parallel.pyx":153 * * # preallocate memory * cue_indices = malloc(sizeof(unsigned int) * max_number_of_cues) # <<<<<<<<<<<<<< @@ -2983,7 +3036,7 @@ static int __pyx_f_5pyndl_12ndl_parallel_learn_inplace_ptr(char *__pyx_v_binary_ */ __pyx_v_cue_indices = ((unsigned int *)malloc(((sizeof(unsigned int)) * __pyx_v_max_number_of_cues))); - /* "pyndl/ndl_parallel.pyx":140 + /* "pyndl/ndl_parallel.pyx":154 * # preallocate memory * cue_indices = malloc(sizeof(unsigned int) * max_number_of_cues) * outcome_indices = malloc(sizeof(unsigned int) * max_number_of_outcomes) # <<<<<<<<<<<<<< @@ -2992,7 +3045,7 @@ static int __pyx_f_5pyndl_12ndl_parallel_learn_inplace_ptr(char *__pyx_v_binary_ */ __pyx_v_outcome_indices = ((unsigned int *)malloc(((sizeof(unsigned int)) * __pyx_v_max_number_of_outcomes))); - /* "pyndl/ndl_parallel.pyx":142 + /* "pyndl/ndl_parallel.pyx":156 * outcome_indices = malloc(sizeof(unsigned int) * max_number_of_outcomes) * * read_next_int(&number_of_events, binary_file) # <<<<<<<<<<<<<< @@ -3001,7 +3054,7 @@ static int __pyx_f_5pyndl_12ndl_parallel_learn_inplace_ptr(char *__pyx_v_binary_ */ __pyx_f_5pyndl_12ndl_parallel_read_next_int((&__pyx_v_number_of_events), __pyx_v_binary_file); - /* "pyndl/ndl_parallel.pyx":144 + /* "pyndl/ndl_parallel.pyx":158 * read_next_int(&number_of_events, binary_file) * * for event in range(number_of_events): # <<<<<<<<<<<<<< @@ -3009,10 +3062,11 @@ static int __pyx_f_5pyndl_12ndl_parallel_learn_inplace_ptr(char *__pyx_v_binary_ * read_next_int(&number_of_cues, binary_file) */ __pyx_t_2 = __pyx_v_number_of_events; - for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { - __pyx_v_event = __pyx_t_3; + __pyx_t_3 = __pyx_t_2; + for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { + __pyx_v_event = __pyx_t_4; - /* "pyndl/ndl_parallel.pyx":146 + /* "pyndl/ndl_parallel.pyx":160 * for event in range(number_of_events): * # cues * read_next_int(&number_of_cues, binary_file) # <<<<<<<<<<<<<< @@ -3021,7 +3075,7 @@ static int __pyx_f_5pyndl_12ndl_parallel_learn_inplace_ptr(char *__pyx_v_binary_ */ __pyx_f_5pyndl_12ndl_parallel_read_next_int((&__pyx_v_number_of_cues), __pyx_v_binary_file); - /* "pyndl/ndl_parallel.pyx":147 + /* "pyndl/ndl_parallel.pyx":161 * # cues * read_next_int(&number_of_cues, binary_file) * if number_of_cues > max_number_of_cues: # <<<<<<<<<<<<<< @@ -3031,7 +3085,7 @@ static int __pyx_f_5pyndl_12ndl_parallel_learn_inplace_ptr(char *__pyx_v_binary_ __pyx_t_1 = ((__pyx_v_number_of_cues > __pyx_v_max_number_of_cues) != 0); if (__pyx_t_1) { - /* "pyndl/ndl_parallel.pyx":148 + /* "pyndl/ndl_parallel.pyx":162 * read_next_int(&number_of_cues, binary_file) * if number_of_cues > max_number_of_cues: * max_number_of_cues = number_of_cues # <<<<<<<<<<<<<< @@ -3040,7 +3094,7 @@ static int __pyx_f_5pyndl_12ndl_parallel_learn_inplace_ptr(char *__pyx_v_binary_ */ __pyx_v_max_number_of_cues = __pyx_v_number_of_cues; - /* "pyndl/ndl_parallel.pyx":149 + /* "pyndl/ndl_parallel.pyx":163 * if number_of_cues > max_number_of_cues: * max_number_of_cues = number_of_cues * free(cue_indices) # <<<<<<<<<<<<<< @@ -3049,7 +3103,7 @@ static int __pyx_f_5pyndl_12ndl_parallel_learn_inplace_ptr(char *__pyx_v_binary_ */ free(__pyx_v_cue_indices); - /* "pyndl/ndl_parallel.pyx":150 + /* "pyndl/ndl_parallel.pyx":164 * max_number_of_cues = number_of_cues * free(cue_indices) * cue_indices = malloc(sizeof(unsigned int) * max_number_of_cues) # <<<<<<<<<<<<<< @@ -3058,7 +3112,7 @@ static int __pyx_f_5pyndl_12ndl_parallel_learn_inplace_ptr(char *__pyx_v_binary_ */ __pyx_v_cue_indices = ((unsigned int *)malloc(((sizeof(unsigned int)) * __pyx_v_max_number_of_cues))); - /* "pyndl/ndl_parallel.pyx":147 + /* "pyndl/ndl_parallel.pyx":161 * # cues * read_next_int(&number_of_cues, binary_file) * if number_of_cues > max_number_of_cues: # <<<<<<<<<<<<<< @@ -3067,16 +3121,16 @@ static int __pyx_f_5pyndl_12ndl_parallel_learn_inplace_ptr(char *__pyx_v_binary_ */ } - /* "pyndl/ndl_parallel.pyx":151 + /* "pyndl/ndl_parallel.pyx":165 * free(cue_indices) * cue_indices = malloc(sizeof(unsigned int) * max_number_of_cues) * fread(cue_indices, 4, number_of_cues, binary_file) # <<<<<<<<<<<<<< * * # outcomes */ - fread(__pyx_v_cue_indices, 4, __pyx_v_number_of_cues, __pyx_v_binary_file); + (void)(fread(__pyx_v_cue_indices, 4, __pyx_v_number_of_cues, __pyx_v_binary_file)); - /* "pyndl/ndl_parallel.pyx":154 + /* "pyndl/ndl_parallel.pyx":168 * * # outcomes * read_next_int(&number_of_outcomes, binary_file) # <<<<<<<<<<<<<< @@ -3085,7 +3139,7 @@ static int __pyx_f_5pyndl_12ndl_parallel_learn_inplace_ptr(char *__pyx_v_binary_ */ __pyx_f_5pyndl_12ndl_parallel_read_next_int((&__pyx_v_number_of_outcomes), __pyx_v_binary_file); - /* "pyndl/ndl_parallel.pyx":155 + /* "pyndl/ndl_parallel.pyx":169 * # outcomes * read_next_int(&number_of_outcomes, binary_file) * if number_of_outcomes > max_number_of_outcomes: # <<<<<<<<<<<<<< @@ -3095,7 +3149,7 @@ static int __pyx_f_5pyndl_12ndl_parallel_learn_inplace_ptr(char *__pyx_v_binary_ __pyx_t_1 = ((__pyx_v_number_of_outcomes > __pyx_v_max_number_of_outcomes) != 0); if (__pyx_t_1) { - /* "pyndl/ndl_parallel.pyx":156 + /* "pyndl/ndl_parallel.pyx":170 * read_next_int(&number_of_outcomes, binary_file) * if number_of_outcomes > max_number_of_outcomes: * max_number_of_outcomes = number_of_outcomes # <<<<<<<<<<<<<< @@ -3104,7 +3158,7 @@ static int __pyx_f_5pyndl_12ndl_parallel_learn_inplace_ptr(char *__pyx_v_binary_ */ __pyx_v_max_number_of_outcomes = __pyx_v_number_of_outcomes; - /* "pyndl/ndl_parallel.pyx":157 + /* "pyndl/ndl_parallel.pyx":171 * if number_of_outcomes > max_number_of_outcomes: * max_number_of_outcomes = number_of_outcomes * free(outcome_indices) # <<<<<<<<<<<<<< @@ -3113,7 +3167,7 @@ static int __pyx_f_5pyndl_12ndl_parallel_learn_inplace_ptr(char *__pyx_v_binary_ */ free(__pyx_v_outcome_indices); - /* "pyndl/ndl_parallel.pyx":158 + /* "pyndl/ndl_parallel.pyx":172 * max_number_of_outcomes = number_of_outcomes * free(outcome_indices) * outcome_indices = malloc(sizeof(unsigned int) * max_number_of_outcomes) # <<<<<<<<<<<<<< @@ -3122,7 +3176,7 @@ static int __pyx_f_5pyndl_12ndl_parallel_learn_inplace_ptr(char *__pyx_v_binary_ */ __pyx_v_outcome_indices = ((unsigned int *)malloc(((sizeof(unsigned int)) * __pyx_v_max_number_of_outcomes))); - /* "pyndl/ndl_parallel.pyx":155 + /* "pyndl/ndl_parallel.pyx":169 * # outcomes * read_next_int(&number_of_outcomes, binary_file) * if number_of_outcomes > max_number_of_outcomes: # <<<<<<<<<<<<<< @@ -3131,58 +3185,78 @@ static int __pyx_f_5pyndl_12ndl_parallel_learn_inplace_ptr(char *__pyx_v_binary_ */ } - /* "pyndl/ndl_parallel.pyx":159 + /* "pyndl/ndl_parallel.pyx":173 * free(outcome_indices) * outcome_indices = malloc(sizeof(unsigned int) * max_number_of_outcomes) * fread(outcome_indices, 4, number_of_outcomes, binary_file) # <<<<<<<<<<<<<< * * # learn */ - fread(__pyx_v_outcome_indices, 4, __pyx_v_number_of_outcomes, __pyx_v_binary_file); + (void)(fread(__pyx_v_outcome_indices, 4, __pyx_v_number_of_outcomes, __pyx_v_binary_file)); - /* "pyndl/ndl_parallel.pyx":162 + /* "pyndl/ndl_parallel.pyx":176 * * # learn * for ii in range(start, end): # <<<<<<<<<<<<<< * association_strength = 0.0 * for jj in range(number_of_cues): */ - __pyx_t_4 = __pyx_v_end; - for (__pyx_t_5 = __pyx_v_start; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) { - __pyx_v_ii = __pyx_t_5; + __pyx_t_5 = __pyx_v_end; + __pyx_t_6 = __pyx_t_5; + for (__pyx_t_7 = __pyx_v_start; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) { + __pyx_v_ii = __pyx_t_7; - /* "pyndl/ndl_parallel.pyx":163 + /* "pyndl/ndl_parallel.pyx":177 * # learn * for ii in range(start, end): * association_strength = 0.0 # <<<<<<<<<<<<<< * for jj in range(number_of_cues): - * index = cue_indices[jj] + mm * all_outcome_indices[ii] + * # this overflows: */ __pyx_v_association_strength = 0.0; - /* "pyndl/ndl_parallel.pyx":164 + /* "pyndl/ndl_parallel.pyx":178 * for ii in range(start, end): * association_strength = 0.0 * for jj in range(number_of_cues): # <<<<<<<<<<<<<< - * index = cue_indices[jj] + mm * all_outcome_indices[ii] - * association_strength += weights[index] - */ - __pyx_t_6 = __pyx_v_number_of_cues; - for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) { - __pyx_v_jj = __pyx_t_7; - - /* "pyndl/ndl_parallel.pyx":165 - * association_strength = 0.0 - * for jj in range(number_of_cues): - * index = cue_indices[jj] + mm * all_outcome_indices[ii] # <<<<<<<<<<<<<< + * # this overflows: + * #index = cue_indices[jj] + mm * all_outcome_indices[ii] + */ + __pyx_t_8 = __pyx_v_number_of_cues; + __pyx_t_9 = __pyx_t_8; + for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { + __pyx_v_jj = __pyx_t_10; + + /* "pyndl/ndl_parallel.pyx":181 + * # this overflows: + * #index = cue_indices[jj] + mm * all_outcome_indices[ii] + * index = mm # implicit cast to unsigned long long # <<<<<<<<<<<<<< + * index *= all_outcome_indices[ii] # this can't overflow anymore + * index += cue_indices[jj] # this can't overflow anymore + */ + __pyx_v_index = __pyx_v_mm; + + /* "pyndl/ndl_parallel.pyx":182 + * #index = cue_indices[jj] + mm * all_outcome_indices[ii] + * index = mm # implicit cast to unsigned long long + * index *= all_outcome_indices[ii] # this can't overflow anymore # <<<<<<<<<<<<<< + * index += cue_indices[jj] # this can't overflow anymore + * # worst case: 4294967295 * 4294967295 + 4294967295 == 18446744069414584320 < 18446744073709551615 + */ + __pyx_v_index = (__pyx_v_index * (__pyx_v_all_outcome_indices[__pyx_v_ii])); + + /* "pyndl/ndl_parallel.pyx":183 + * index = mm # implicit cast to unsigned long long + * index *= all_outcome_indices[ii] # this can't overflow anymore + * index += cue_indices[jj] # this can't overflow anymore # <<<<<<<<<<<<<< + * # worst case: 4294967295 * 4294967295 + 4294967295 == 18446744069414584320 < 18446744073709551615 * association_strength += weights[index] - * if is_element_of(all_outcome_indices[ii], outcome_indices, number_of_outcomes): */ - __pyx_v_index = ((__pyx_v_cue_indices[__pyx_v_jj]) + (__pyx_v_mm * (__pyx_v_all_outcome_indices[__pyx_v_ii]))); + __pyx_v_index = (__pyx_v_index + (__pyx_v_cue_indices[__pyx_v_jj])); - /* "pyndl/ndl_parallel.pyx":166 - * for jj in range(number_of_cues): - * index = cue_indices[jj] + mm * all_outcome_indices[ii] + /* "pyndl/ndl_parallel.pyx":185 + * index += cue_indices[jj] # this can't overflow anymore + * # worst case: 4294967295 * 4294967295 + 4294967295 == 18446744069414584320 < 18446744073709551615 * association_strength += weights[index] # <<<<<<<<<<<<<< * if is_element_of(all_outcome_indices[ii], outcome_indices, number_of_outcomes): * update = beta1 * (lambda_ - association_strength) @@ -3190,8 +3264,8 @@ static int __pyx_f_5pyndl_12ndl_parallel_learn_inplace_ptr(char *__pyx_v_binary_ __pyx_v_association_strength = (__pyx_v_association_strength + (__pyx_v_weights[__pyx_v_index])); } - /* "pyndl/ndl_parallel.pyx":167 - * index = cue_indices[jj] + mm * all_outcome_indices[ii] + /* "pyndl/ndl_parallel.pyx":186 + * # worst case: 4294967295 * 4294967295 + 4294967295 == 18446744069414584320 < 18446744073709551615 * association_strength += weights[index] * if is_element_of(all_outcome_indices[ii], outcome_indices, number_of_outcomes): # <<<<<<<<<<<<<< * update = beta1 * (lambda_ - association_strength) @@ -3200,7 +3274,7 @@ static int __pyx_f_5pyndl_12ndl_parallel_learn_inplace_ptr(char *__pyx_v_binary_ __pyx_t_1 = (__pyx_f_5pyndl_12ndl_parallel_is_element_of((__pyx_v_all_outcome_indices[__pyx_v_ii]), __pyx_v_outcome_indices, __pyx_v_number_of_outcomes) != 0); if (__pyx_t_1) { - /* "pyndl/ndl_parallel.pyx":168 + /* "pyndl/ndl_parallel.pyx":187 * association_strength += weights[index] * if is_element_of(all_outcome_indices[ii], outcome_indices, number_of_outcomes): * update = beta1 * (lambda_ - association_strength) # <<<<<<<<<<<<<< @@ -3209,8 +3283,8 @@ static int __pyx_f_5pyndl_12ndl_parallel_learn_inplace_ptr(char *__pyx_v_binary_ */ __pyx_v_update = (__pyx_v_beta1 * (__pyx_v_lambda_ - __pyx_v_association_strength)); - /* "pyndl/ndl_parallel.pyx":167 - * index = cue_indices[jj] + mm * all_outcome_indices[ii] + /* "pyndl/ndl_parallel.pyx":186 + * # worst case: 4294967295 * 4294967295 + 4294967295 == 18446744069414584320 < 18446744073709551615 * association_strength += weights[index] * if is_element_of(all_outcome_indices[ii], outcome_indices, number_of_outcomes): # <<<<<<<<<<<<<< * update = beta1 * (lambda_ - association_strength) @@ -3219,61 +3293,80 @@ static int __pyx_f_5pyndl_12ndl_parallel_learn_inplace_ptr(char *__pyx_v_binary_ goto __pyx_L13; } - /* "pyndl/ndl_parallel.pyx":170 + /* "pyndl/ndl_parallel.pyx":189 * update = beta1 * (lambda_ - association_strength) * else: * update = beta2 * (0.0 - association_strength) # <<<<<<<<<<<<<< * for jj in range(number_of_cues): - * index = cue_indices[jj] + mm * all_outcome_indices[ii] + * index = mm # implicit cast to unsigned long long */ /*else*/ { __pyx_v_update = (__pyx_v_beta2 * (0.0 - __pyx_v_association_strength)); } __pyx_L13:; - /* "pyndl/ndl_parallel.pyx":171 + /* "pyndl/ndl_parallel.pyx":190 * else: * update = beta2 * (0.0 - association_strength) * for jj in range(number_of_cues): # <<<<<<<<<<<<<< - * index = cue_indices[jj] + mm * all_outcome_indices[ii] - * weights[index] += alpha * update + * index = mm # implicit cast to unsigned long long + * index *= all_outcome_indices[ii] # this can't overflow anymore */ - __pyx_t_6 = __pyx_v_number_of_cues; - for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) { - __pyx_v_jj = __pyx_t_7; + __pyx_t_8 = __pyx_v_number_of_cues; + __pyx_t_9 = __pyx_t_8; + for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { + __pyx_v_jj = __pyx_t_10; - /* "pyndl/ndl_parallel.pyx":172 + /* "pyndl/ndl_parallel.pyx":191 * update = beta2 * (0.0 - association_strength) * for jj in range(number_of_cues): - * index = cue_indices[jj] + mm * all_outcome_indices[ii] # <<<<<<<<<<<<<< + * index = mm # implicit cast to unsigned long long # <<<<<<<<<<<<<< + * index *= all_outcome_indices[ii] # this can't overflow anymore + * index += cue_indices[jj] # this can't overflow anymore + */ + __pyx_v_index = __pyx_v_mm; + + /* "pyndl/ndl_parallel.pyx":192 + * for jj in range(number_of_cues): + * index = mm # implicit cast to unsigned long long + * index *= all_outcome_indices[ii] # this can't overflow anymore # <<<<<<<<<<<<<< + * index += cue_indices[jj] # this can't overflow anymore + * weights[index] += alpha * update + */ + __pyx_v_index = (__pyx_v_index * (__pyx_v_all_outcome_indices[__pyx_v_ii])); + + /* "pyndl/ndl_parallel.pyx":193 + * index = mm # implicit cast to unsigned long long + * index *= all_outcome_indices[ii] # this can't overflow anymore + * index += cue_indices[jj] # this can't overflow anymore # <<<<<<<<<<<<<< * weights[index] += alpha * update * */ - __pyx_v_index = ((__pyx_v_cue_indices[__pyx_v_jj]) + (__pyx_v_mm * (__pyx_v_all_outcome_indices[__pyx_v_ii]))); + __pyx_v_index = (__pyx_v_index + (__pyx_v_cue_indices[__pyx_v_jj])); - /* "pyndl/ndl_parallel.pyx":173 - * for jj in range(number_of_cues): - * index = cue_indices[jj] + mm * all_outcome_indices[ii] + /* "pyndl/ndl_parallel.pyx":194 + * index *= all_outcome_indices[ii] # this can't overflow anymore + * index += cue_indices[jj] # this can't overflow anymore * weights[index] += alpha * update # <<<<<<<<<<<<<< * * fclose(binary_file) */ - __pyx_t_8 = __pyx_v_index; - (__pyx_v_weights[__pyx_t_8]) = ((__pyx_v_weights[__pyx_t_8]) + (__pyx_v_alpha * __pyx_v_update)); + __pyx_t_11 = __pyx_v_index; + (__pyx_v_weights[__pyx_t_11]) = ((__pyx_v_weights[__pyx_t_11]) + (__pyx_v_alpha * __pyx_v_update)); } } } - /* "pyndl/ndl_parallel.pyx":175 + /* "pyndl/ndl_parallel.pyx":196 * weights[index] += alpha * update * * fclose(binary_file) # <<<<<<<<<<<<<< * free(cue_indices) * free(outcome_indices) */ - fclose(__pyx_v_binary_file); + (void)(fclose(__pyx_v_binary_file)); - /* "pyndl/ndl_parallel.pyx":176 + /* "pyndl/ndl_parallel.pyx":197 * * fclose(binary_file) * free(cue_indices) # <<<<<<<<<<<<<< @@ -3282,7 +3375,7 @@ static int __pyx_f_5pyndl_12ndl_parallel_learn_inplace_ptr(char *__pyx_v_binary_ */ free(__pyx_v_cue_indices); - /* "pyndl/ndl_parallel.pyx":177 + /* "pyndl/ndl_parallel.pyx":198 * fclose(binary_file) * free(cue_indices) * free(outcome_indices) # <<<<<<<<<<<<<< @@ -3290,7 +3383,7 @@ static int __pyx_f_5pyndl_12ndl_parallel_learn_inplace_ptr(char *__pyx_v_binary_ */ free(__pyx_v_outcome_indices); - /* "pyndl/ndl_parallel.pyx":178 + /* "pyndl/ndl_parallel.pyx":199 * free(cue_indices) * free(outcome_indices) * return 0 # <<<<<<<<<<<<<< @@ -3298,7 +3391,7 @@ static int __pyx_f_5pyndl_12ndl_parallel_learn_inplace_ptr(char *__pyx_v_binary_ __pyx_r = 0; goto __pyx_L0; - /* "pyndl/ndl_parallel.pyx":107 + /* "pyndl/ndl_parallel.pyx":120 * * # ggf exception zurckgeben * cdef int learn_inplace_ptr(char* binary_file_path, dtype_t* weights, # <<<<<<<<<<<<<< @@ -3311,12 +3404,12 @@ static int __pyx_f_5pyndl_12ndl_parallel_learn_inplace_ptr(char *__pyx_v_binary_ return __pyx_r; } -/* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":214 +/* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":215 * # experimental exception made for __getbuffer__ and __releasebuffer__ * # -- the details of this may change. * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< * # This implementation of getbuffer is geared towards Cython - * # requirements, and does not yet fullfill the PEP. + * # requirements, and does not yet fulfill the PEP. */ /* Python wrapper */ @@ -3333,7 +3426,6 @@ static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx } static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { - int __pyx_v_copy_shape; int __pyx_v_i; int __pyx_v_ndim; int __pyx_v_endian_detector; @@ -3342,7 +3434,6 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P char *__pyx_v_f; PyArray_Descr *__pyx_v_descr = 0; int __pyx_v_offset; - int __pyx_v_hasfields; int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; @@ -3350,38 +3441,28 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_t_5; - PyObject *__pyx_t_6 = NULL; - char *__pyx_t_7; - __Pyx_RefNannySetupContext("__getbuffer__", 0); - if (__pyx_v_info != NULL) { - __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(__pyx_v_info->obj); - } - - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":220 - * # of flags - * - * if info == NULL: return # <<<<<<<<<<<<<< - * - * cdef int copy_shape, i, ndim - */ - __pyx_t_1 = ((__pyx_v_info == NULL) != 0); - if (__pyx_t_1) { - __pyx_r = 0; - goto __pyx_L0; + int __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + char *__pyx_t_8; + if (__pyx_v_info == NULL) { + PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete"); + return -1; } + __Pyx_RefNannySetupContext("__getbuffer__", 0); + __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(__pyx_v_info->obj); - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":223 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":222 * - * cdef int copy_shape, i, ndim + * cdef int i, ndim * cdef int endian_detector = 1 # <<<<<<<<<<<<<< * cdef bint little_endian = ((&endian_detector)[0] != 0) * */ __pyx_v_endian_detector = 1; - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":224 - * cdef int copy_shape, i, ndim + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":223 + * cdef int i, ndim * cdef int endian_detector = 1 * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< * @@ -3389,59 +3470,18 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":226 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":225 * cdef bint little_endian = ((&endian_detector)[0] != 0) * * ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<< * - * if sizeof(npy_intp) != sizeof(Py_ssize_t): + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) */ __pyx_v_ndim = PyArray_NDIM(__pyx_v_self); - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":228 - * ndim = PyArray_NDIM(self) - * - * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< - * copy_shape = 1 - * else: - */ - __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); - if (__pyx_t_1) { - - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":229 - * - * if sizeof(npy_intp) != sizeof(Py_ssize_t): - * copy_shape = 1 # <<<<<<<<<<<<<< - * else: - * copy_shape = 0 - */ - __pyx_v_copy_shape = 1; - - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":228 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":227 * ndim = PyArray_NDIM(self) * - * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< - * copy_shape = 1 - * else: - */ - goto __pyx_L4; - } - - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":231 - * copy_shape = 1 - * else: - * copy_shape = 0 # <<<<<<<<<<<<<< - * - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) - */ - /*else*/ { - __pyx_v_copy_shape = 0; - } - __pyx_L4:; - - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":233 - * copy_shape = 0 - * * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): * raise ValueError(u"ndarray is not C contiguous") @@ -3450,10 +3490,10 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P if (__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; - goto __pyx_L6_bool_binop_done; + goto __pyx_L4_bool_binop_done; } - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":234 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":228 * * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): # <<<<<<<<<<<<<< @@ -3462,32 +3502,32 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_C_CONTIGUOUS) != 0)) != 0); __pyx_t_1 = __pyx_t_2; - __pyx_L6_bool_binop_done:; + __pyx_L4_bool_binop_done:; - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":233 - * copy_shape = 0 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":227 + * ndim = PyArray_NDIM(self) * * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): * raise ValueError(u"ndarray is not C contiguous") */ - if (__pyx_t_1) { + if (unlikely(__pyx_t_1)) { - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":235 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":229 * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<< * * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 235, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 229, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(1, 235, __pyx_L1_error) + __PYX_ERR(1, 229, __pyx_L1_error) - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":233 - * copy_shape = 0 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":227 + * ndim = PyArray_NDIM(self) * * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): @@ -3495,7 +3535,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ } - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":237 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":231 * raise ValueError(u"ndarray is not C contiguous") * * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< @@ -3506,10 +3546,10 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P if (__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; - goto __pyx_L9_bool_binop_done; + goto __pyx_L7_bool_binop_done; } - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":238 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":232 * * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): # <<<<<<<<<<<<<< @@ -3518,31 +3558,31 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_F_CONTIGUOUS) != 0)) != 0); __pyx_t_1 = __pyx_t_2; - __pyx_L9_bool_binop_done:; + __pyx_L7_bool_binop_done:; - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":237 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":231 * raise ValueError(u"ndarray is not C contiguous") * * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): * raise ValueError(u"ndarray is not Fortran contiguous") */ - if (__pyx_t_1) { + if (unlikely(__pyx_t_1)) { - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":239 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":233 * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<< * * info.buf = PyArray_DATA(self) */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 239, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 233, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(1, 239, __pyx_L1_error) + __PYX_ERR(1, 233, __pyx_L1_error) - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":237 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":231 * raise ValueError(u"ndarray is not C contiguous") * * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< @@ -3551,35 +3591,35 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ } - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":241 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":235 * raise ValueError(u"ndarray is not Fortran contiguous") * * info.buf = PyArray_DATA(self) # <<<<<<<<<<<<<< * info.ndim = ndim - * if copy_shape: + * if sizeof(npy_intp) != sizeof(Py_ssize_t): */ __pyx_v_info->buf = PyArray_DATA(__pyx_v_self); - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":242 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":236 * * info.buf = PyArray_DATA(self) * info.ndim = ndim # <<<<<<<<<<<<<< - * if copy_shape: + * if sizeof(npy_intp) != sizeof(Py_ssize_t): * # Allocate new buffer for strides and shape info. */ __pyx_v_info->ndim = __pyx_v_ndim; - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":243 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":237 * info.buf = PyArray_DATA(self) * info.ndim = ndim - * if copy_shape: # <<<<<<<<<<<<<< + * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< * # Allocate new buffer for strides and shape info. * # This is allocated as one block, strides first. */ - __pyx_t_1 = (__pyx_v_copy_shape != 0); + __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); if (__pyx_t_1) { - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":246 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":240 * # Allocate new buffer for strides and shape info. * # This is allocated as one block, strides first. * info.strides = PyObject_Malloc(sizeof(Py_ssize_t) * 2 * ndim) # <<<<<<<<<<<<<< @@ -3588,7 +3628,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->strides = ((Py_ssize_t *)PyObject_Malloc((((sizeof(Py_ssize_t)) * 2) * ((size_t)__pyx_v_ndim)))); - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":247 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":241 * # This is allocated as one block, strides first. * info.strides = PyObject_Malloc(sizeof(Py_ssize_t) * 2 * ndim) * info.shape = info.strides + ndim # <<<<<<<<<<<<<< @@ -3597,7 +3637,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim); - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":248 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":242 * info.strides = PyObject_Malloc(sizeof(Py_ssize_t) * 2 * ndim) * info.shape = info.strides + ndim * for i in range(ndim): # <<<<<<<<<<<<<< @@ -3605,10 +3645,11 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P * info.shape[i] = PyArray_DIMS(self)[i] */ __pyx_t_4 = __pyx_v_ndim; - for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) { - __pyx_v_i = __pyx_t_5; + __pyx_t_5 = __pyx_t_4; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { + __pyx_v_i = __pyx_t_6; - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":249 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":243 * info.shape = info.strides + ndim * for i in range(ndim): * info.strides[i] = PyArray_STRIDES(self)[i] # <<<<<<<<<<<<<< @@ -3617,7 +3658,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]); - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":250 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":244 * for i in range(ndim): * info.strides[i] = PyArray_STRIDES(self)[i] * info.shape[i] = PyArray_DIMS(self)[i] # <<<<<<<<<<<<<< @@ -3627,17 +3668,17 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]); } - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":243 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":237 * info.buf = PyArray_DATA(self) * info.ndim = ndim - * if copy_shape: # <<<<<<<<<<<<<< + * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< * # Allocate new buffer for strides and shape info. * # This is allocated as one block, strides first. */ - goto __pyx_L11; + goto __pyx_L9; } - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":252 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":246 * info.shape[i] = PyArray_DIMS(self)[i] * else: * info.strides = PyArray_STRIDES(self) # <<<<<<<<<<<<<< @@ -3647,7 +3688,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P /*else*/ { __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self)); - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":253 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":247 * else: * info.strides = PyArray_STRIDES(self) * info.shape = PyArray_DIMS(self) # <<<<<<<<<<<<<< @@ -3656,9 +3697,9 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->shape = ((Py_ssize_t *)PyArray_DIMS(__pyx_v_self)); } - __pyx_L11:; + __pyx_L9:; - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":254 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":248 * info.strides = PyArray_STRIDES(self) * info.shape = PyArray_DIMS(self) * info.suboffsets = NULL # <<<<<<<<<<<<<< @@ -3667,7 +3708,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->suboffsets = NULL; - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":255 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":249 * info.shape = PyArray_DIMS(self) * info.suboffsets = NULL * info.itemsize = PyArray_ITEMSIZE(self) # <<<<<<<<<<<<<< @@ -3676,7 +3717,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self); - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":256 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":250 * info.suboffsets = NULL * info.itemsize = PyArray_ITEMSIZE(self) * info.readonly = not PyArray_ISWRITEABLE(self) # <<<<<<<<<<<<<< @@ -3685,7 +3726,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0)); - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":259 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":253 * * cdef int t * cdef char* f = NULL # <<<<<<<<<<<<<< @@ -3694,7 +3735,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_f = NULL; - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":260 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":254 * cdef int t * cdef char* f = NULL * cdef dtype descr = self.descr # <<<<<<<<<<<<<< @@ -3706,85 +3747,32 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_descr = ((PyArray_Descr *)__pyx_t_3); __pyx_t_3 = 0; - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":263 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":257 * cdef int offset * - * cdef bint hasfields = PyDataType_HASFIELDS(descr) # <<<<<<<<<<<<<< - * - * if not hasfields and not copy_shape: - */ - __pyx_v_hasfields = PyDataType_HASFIELDS(__pyx_v_descr); - - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":265 - * cdef bint hasfields = PyDataType_HASFIELDS(descr) - * - * if not hasfields and not copy_shape: # <<<<<<<<<<<<<< - * # do not call releasebuffer - * info.obj = None - */ - __pyx_t_2 = ((!(__pyx_v_hasfields != 0)) != 0); - if (__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L15_bool_binop_done; - } - __pyx_t_2 = ((!(__pyx_v_copy_shape != 0)) != 0); - __pyx_t_1 = __pyx_t_2; - __pyx_L15_bool_binop_done:; - if (__pyx_t_1) { - - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":267 - * if not hasfields and not copy_shape: - * # do not call releasebuffer - * info.obj = None # <<<<<<<<<<<<<< - * else: - * # need to call releasebuffer - */ - __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(Py_None); - __Pyx_GOTREF(__pyx_v_info->obj); - __Pyx_DECREF(__pyx_v_info->obj); - __pyx_v_info->obj = Py_None; - - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":265 - * cdef bint hasfields = PyDataType_HASFIELDS(descr) - * - * if not hasfields and not copy_shape: # <<<<<<<<<<<<<< - * # do not call releasebuffer - * info.obj = None - */ - goto __pyx_L14; - } - - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":270 - * else: - * # need to call releasebuffer - * info.obj = self # <<<<<<<<<<<<<< + * info.obj = self # <<<<<<<<<<<<<< * - * if not hasfields: + * if not PyDataType_HASFIELDS(descr): */ - /*else*/ { - __Pyx_INCREF(((PyObject *)__pyx_v_self)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); - __Pyx_GOTREF(__pyx_v_info->obj); - __Pyx_DECREF(__pyx_v_info->obj); - __pyx_v_info->obj = ((PyObject *)__pyx_v_self); - } - __pyx_L14:; + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); + __pyx_v_info->obj = ((PyObject *)__pyx_v_self); - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":272 - * info.obj = self + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":259 + * info.obj = self * - * if not hasfields: # <<<<<<<<<<<<<< + * if not PyDataType_HASFIELDS(descr): # <<<<<<<<<<<<<< * t = descr.type_num * if ((descr.byteorder == c'>' and little_endian) or */ - __pyx_t_1 = ((!(__pyx_v_hasfields != 0)) != 0); + __pyx_t_1 = ((!(PyDataType_HASFIELDS(__pyx_v_descr) != 0)) != 0); if (__pyx_t_1) { - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":273 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":260 * - * if not hasfields: + * if not PyDataType_HASFIELDS(descr): * t = descr.type_num # <<<<<<<<<<<<<< * if ((descr.byteorder == c'>' and little_endian) or * (descr.byteorder == c'<' and not little_endian)): @@ -3792,8 +3780,8 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_t_4 = __pyx_v_descr->type_num; __pyx_v_t = __pyx_t_4; - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":274 - * if not hasfields: + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":261 + * if not PyDataType_HASFIELDS(descr): * t = descr.type_num * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< * (descr.byteorder == c'<' and not little_endian)): @@ -3801,18 +3789,18 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_t_2 = ((__pyx_v_descr->byteorder == '>') != 0); if (!__pyx_t_2) { - goto __pyx_L20_next_or; + goto __pyx_L15_next_or; } else { } __pyx_t_2 = (__pyx_v_little_endian != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; - goto __pyx_L19_bool_binop_done; + goto __pyx_L14_bool_binop_done; } - __pyx_L20_next_or:; + __pyx_L15_next_or:; - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":275 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":262 * t = descr.type_num * if ((descr.byteorder == c'>' and little_endian) or * (descr.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<< @@ -3823,36 +3811,36 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P if (__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; - goto __pyx_L19_bool_binop_done; + goto __pyx_L14_bool_binop_done; } __pyx_t_2 = ((!(__pyx_v_little_endian != 0)) != 0); __pyx_t_1 = __pyx_t_2; - __pyx_L19_bool_binop_done:; + __pyx_L14_bool_binop_done:; - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":274 - * if not hasfields: + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":261 + * if not PyDataType_HASFIELDS(descr): * t = descr.type_num * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< * (descr.byteorder == c'<' and not little_endian)): * raise ValueError(u"Non-native byte order not supported") */ - if (__pyx_t_1) { + if (unlikely(__pyx_t_1)) { - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":276 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":263 * if ((descr.byteorder == c'>' and little_endian) or * (descr.byteorder == c'<' and not little_endian)): * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< * if t == NPY_BYTE: f = "b" * elif t == NPY_UBYTE: f = "B" */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 276, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 263, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(1, 276, __pyx_L1_error) + __PYX_ERR(1, 263, __pyx_L1_error) - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":274 - * if not hasfields: + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":261 + * if not PyDataType_HASFIELDS(descr): * t = descr.type_num * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< * (descr.byteorder == c'<' and not little_endian)): @@ -3860,7 +3848,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ } - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":277 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":264 * (descr.byteorder == c'<' and not little_endian)): * raise ValueError(u"Non-native byte order not supported") * if t == NPY_BYTE: f = "b" # <<<<<<<<<<<<<< @@ -3872,7 +3860,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"b"); break; - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":278 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":265 * raise ValueError(u"Non-native byte order not supported") * if t == NPY_BYTE: f = "b" * elif t == NPY_UBYTE: f = "B" # <<<<<<<<<<<<<< @@ -3883,7 +3871,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"B"); break; - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":279 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":266 * if t == NPY_BYTE: f = "b" * elif t == NPY_UBYTE: f = "B" * elif t == NPY_SHORT: f = "h" # <<<<<<<<<<<<<< @@ -3894,7 +3882,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"h"); break; - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":280 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":267 * elif t == NPY_UBYTE: f = "B" * elif t == NPY_SHORT: f = "h" * elif t == NPY_USHORT: f = "H" # <<<<<<<<<<<<<< @@ -3905,7 +3893,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"H"); break; - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":281 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":268 * elif t == NPY_SHORT: f = "h" * elif t == NPY_USHORT: f = "H" * elif t == NPY_INT: f = "i" # <<<<<<<<<<<<<< @@ -3916,7 +3904,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"i"); break; - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":282 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":269 * elif t == NPY_USHORT: f = "H" * elif t == NPY_INT: f = "i" * elif t == NPY_UINT: f = "I" # <<<<<<<<<<<<<< @@ -3927,7 +3915,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"I"); break; - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":283 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":270 * elif t == NPY_INT: f = "i" * elif t == NPY_UINT: f = "I" * elif t == NPY_LONG: f = "l" # <<<<<<<<<<<<<< @@ -3938,7 +3926,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"l"); break; - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":284 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":271 * elif t == NPY_UINT: f = "I" * elif t == NPY_LONG: f = "l" * elif t == NPY_ULONG: f = "L" # <<<<<<<<<<<<<< @@ -3949,7 +3937,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"L"); break; - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":285 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":272 * elif t == NPY_LONG: f = "l" * elif t == NPY_ULONG: f = "L" * elif t == NPY_LONGLONG: f = "q" # <<<<<<<<<<<<<< @@ -3960,7 +3948,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"q"); break; - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":286 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":273 * elif t == NPY_ULONG: f = "L" * elif t == NPY_LONGLONG: f = "q" * elif t == NPY_ULONGLONG: f = "Q" # <<<<<<<<<<<<<< @@ -3971,7 +3959,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"Q"); break; - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":287 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":274 * elif t == NPY_LONGLONG: f = "q" * elif t == NPY_ULONGLONG: f = "Q" * elif t == NPY_FLOAT: f = "f" # <<<<<<<<<<<<<< @@ -3982,7 +3970,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"f"); break; - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":288 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":275 * elif t == NPY_ULONGLONG: f = "Q" * elif t == NPY_FLOAT: f = "f" * elif t == NPY_DOUBLE: f = "d" # <<<<<<<<<<<<<< @@ -3993,7 +3981,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"d"); break; - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":289 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":276 * elif t == NPY_FLOAT: f = "f" * elif t == NPY_DOUBLE: f = "d" * elif t == NPY_LONGDOUBLE: f = "g" # <<<<<<<<<<<<<< @@ -4004,7 +3992,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"g"); break; - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":290 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":277 * elif t == NPY_DOUBLE: f = "d" * elif t == NPY_LONGDOUBLE: f = "g" * elif t == NPY_CFLOAT: f = "Zf" # <<<<<<<<<<<<<< @@ -4015,7 +4003,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"Zf"); break; - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":291 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":278 * elif t == NPY_LONGDOUBLE: f = "g" * elif t == NPY_CFLOAT: f = "Zf" * elif t == NPY_CDOUBLE: f = "Zd" # <<<<<<<<<<<<<< @@ -4026,7 +4014,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"Zd"); break; - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":292 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":279 * elif t == NPY_CFLOAT: f = "Zf" * elif t == NPY_CDOUBLE: f = "Zd" * elif t == NPY_CLONGDOUBLE: f = "Zg" # <<<<<<<<<<<<<< @@ -4037,7 +4025,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"Zg"); break; - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":293 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":280 * elif t == NPY_CDOUBLE: f = "Zd" * elif t == NPY_CLONGDOUBLE: f = "Zg" * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<< @@ -4049,33 +4037,28 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P break; default: - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":295 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":282 * elif t == NPY_OBJECT: f = "O" * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< * info.format = f * return */ - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 295, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 282, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 295, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 282, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 295, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 282, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_GIVEREF(__pyx_t_6); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); - __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 295, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_Raise(__pyx_t_6, 0, 0, 0); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __PYX_ERR(1, 295, __pyx_L1_error) + __PYX_ERR(1, 282, __pyx_L1_error) break; } - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":296 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":283 * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) * info.format = f # <<<<<<<<<<<<<< @@ -4084,7 +4067,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->format = __pyx_v_f; - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":297 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":284 * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) * info.format = f * return # <<<<<<<<<<<<<< @@ -4094,16 +4077,16 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_r = 0; goto __pyx_L0; - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":272 - * info.obj = self + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":259 + * info.obj = self * - * if not hasfields: # <<<<<<<<<<<<<< + * if not PyDataType_HASFIELDS(descr): # <<<<<<<<<<<<<< * t = descr.type_num * if ((descr.byteorder == c'>' and little_endian) or */ } - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":299 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":286 * return * else: * info.format = PyObject_Malloc(_buffer_format_string_len) # <<<<<<<<<<<<<< @@ -4113,7 +4096,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P /*else*/ { __pyx_v_info->format = ((char *)PyObject_Malloc(0xFF)); - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":300 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":287 * else: * info.format = PyObject_Malloc(_buffer_format_string_len) * info.format[0] = c'^' # Native data types, manual alignment # <<<<<<<<<<<<<< @@ -4122,7 +4105,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ (__pyx_v_info->format[0]) = '^'; - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":301 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":288 * info.format = PyObject_Malloc(_buffer_format_string_len) * info.format[0] = c'^' # Native data types, manual alignment * offset = 0 # <<<<<<<<<<<<<< @@ -4131,17 +4114,17 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_offset = 0; - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":302 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":289 * info.format[0] = c'^' # Native data types, manual alignment * offset = 0 * f = _util_dtypestring(descr, info.format + 1, # <<<<<<<<<<<<<< * info.format + _buffer_format_string_len, * &offset) */ - __pyx_t_7 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 0xFF), (&__pyx_v_offset)); if (unlikely(__pyx_t_7 == ((char *)NULL))) __PYX_ERR(1, 302, __pyx_L1_error) - __pyx_v_f = __pyx_t_7; + __pyx_t_8 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 0xFF), (&__pyx_v_offset)); if (unlikely(__pyx_t_8 == ((char *)NULL))) __PYX_ERR(1, 289, __pyx_L1_error) + __pyx_v_f = __pyx_t_8; - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":305 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":292 * info.format + _buffer_format_string_len, * &offset) * f[0] = c'\0' # Terminate format string # <<<<<<<<<<<<<< @@ -4151,12 +4134,12 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P (__pyx_v_f[0]) = '\x00'; } - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":214 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":215 * # experimental exception made for __getbuffer__ and __releasebuffer__ * # -- the details of this may change. * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< * # This implementation of getbuffer is geared towards Cython - * # requirements, and does not yet fullfill the PEP. + * # requirements, and does not yet fulfill the PEP. */ /* function exit code */ @@ -4164,18 +4147,18 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("numpy.ndarray.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; - if (__pyx_v_info != NULL && __pyx_v_info->obj != NULL) { + if (__pyx_v_info->obj != NULL) { __Pyx_GOTREF(__pyx_v_info->obj); - __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = NULL; + __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0; } goto __pyx_L2; __pyx_L0:; - if (__pyx_v_info != NULL && __pyx_v_info->obj == Py_None) { - __Pyx_GOTREF(Py_None); - __Pyx_DECREF(Py_None); __pyx_v_info->obj = NULL; + if (__pyx_v_info->obj == Py_None) { + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0; } __pyx_L2:; __Pyx_XDECREF((PyObject *)__pyx_v_descr); @@ -4183,7 +4166,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P return __pyx_r; } -/* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":307 +/* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":294 * f[0] = c'\0' # Terminate format string * * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< @@ -4207,7 +4190,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s int __pyx_t_1; __Pyx_RefNannySetupContext("__releasebuffer__", 0); - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":308 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":295 * * def __releasebuffer__(ndarray self, Py_buffer* info): * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< @@ -4217,7 +4200,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0); if (__pyx_t_1) { - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":309 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":296 * def __releasebuffer__(ndarray self, Py_buffer* info): * if PyArray_HASFIELDS(self): * PyObject_Free(info.format) # <<<<<<<<<<<<<< @@ -4226,7 +4209,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s */ PyObject_Free(__pyx_v_info->format); - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":308 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":295 * * def __releasebuffer__(ndarray self, Py_buffer* info): * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< @@ -4235,7 +4218,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s */ } - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":310 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":297 * if PyArray_HASFIELDS(self): * PyObject_Free(info.format) * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< @@ -4245,7 +4228,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); if (__pyx_t_1) { - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":311 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":298 * PyObject_Free(info.format) * if sizeof(npy_intp) != sizeof(Py_ssize_t): * PyObject_Free(info.strides) # <<<<<<<<<<<<<< @@ -4254,7 +4237,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s */ PyObject_Free(__pyx_v_info->strides); - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":310 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":297 * if PyArray_HASFIELDS(self): * PyObject_Free(info.format) * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< @@ -4263,7 +4246,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s */ } - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":307 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":294 * f[0] = c'\0' # Terminate format string * * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< @@ -4275,7 +4258,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s __Pyx_RefNannyFinishContext(); } -/* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":788 +/* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":775 * ctypedef npy_cdouble complex_t * * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< @@ -4289,7 +4272,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0); - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":789 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":776 * * cdef inline object PyArray_MultiIterNew1(a): * return PyArray_MultiIterNew(1, a) # <<<<<<<<<<<<<< @@ -4297,13 +4280,13 @@ 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(1, 789, __pyx_L1_error) + __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 776, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":788 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":775 * ctypedef npy_cdouble complex_t * * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< @@ -4322,7 +4305,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ return __pyx_r; } -/* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":791 +/* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":778 * return PyArray_MultiIterNew(1, a) * * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< @@ -4336,7 +4319,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0); - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":792 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":779 * * cdef inline object PyArray_MultiIterNew2(a, b): * return PyArray_MultiIterNew(2, a, b) # <<<<<<<<<<<<<< @@ -4344,13 +4327,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(1, 792, __pyx_L1_error) + __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 779, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":791 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":778 * return PyArray_MultiIterNew(1, a) * * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< @@ -4369,7 +4352,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ return __pyx_r; } -/* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":794 +/* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":781 * return PyArray_MultiIterNew(2, a, b) * * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< @@ -4383,7 +4366,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0); - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":795 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":782 * * cdef inline object PyArray_MultiIterNew3(a, b, c): * return PyArray_MultiIterNew(3, a, b, c) # <<<<<<<<<<<<<< @@ -4391,13 +4374,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(1, 795, __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(1, 782, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":794 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":781 * return PyArray_MultiIterNew(2, a, b) * * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< @@ -4416,7 +4399,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ return __pyx_r; } -/* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":797 +/* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":784 * return PyArray_MultiIterNew(3, a, b, c) * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< @@ -4430,7 +4413,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0); - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":798 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":785 * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): * return PyArray_MultiIterNew(4, a, b, c, d) # <<<<<<<<<<<<<< @@ -4438,13 +4421,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(1, 798, __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(1, 785, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":797 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":784 * return PyArray_MultiIterNew(3, a, b, c) * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< @@ -4463,7 +4446,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ return __pyx_r; } -/* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":800 +/* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":787 * return PyArray_MultiIterNew(4, a, b, c, d) * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< @@ -4477,7 +4460,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0); - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":801 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":788 * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): * return PyArray_MultiIterNew(5, a, b, c, d, e) # <<<<<<<<<<<<<< @@ -4485,13 +4468,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(1, 801, __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(1, 788, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":800 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":787 * return PyArray_MultiIterNew(4, a, b, c, d) * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< @@ -4510,7 +4493,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ return __pyx_r; } -/* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":803 +/* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":790 * return PyArray_MultiIterNew(5, a, b, c, d, e) * * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<< @@ -4524,7 +4507,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ int __pyx_t_1; __Pyx_RefNannySetupContext("PyDataType_SHAPE", 0); - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":804 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":791 * * cdef inline tuple PyDataType_SHAPE(dtype d): * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<< @@ -4534,7 +4517,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ __pyx_t_1 = (PyDataType_HASSUBARRAY(__pyx_v_d) != 0); if (__pyx_t_1) { - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":805 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":792 * cdef inline tuple PyDataType_SHAPE(dtype d): * if PyDataType_HASSUBARRAY(d): * return d.subarray.shape # <<<<<<<<<<<<<< @@ -4546,7 +4529,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ __pyx_r = ((PyObject*)__pyx_v_d->subarray->shape); goto __pyx_L0; - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":804 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":791 * * cdef inline tuple PyDataType_SHAPE(dtype d): * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<< @@ -4555,7 +4538,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ */ } - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":807 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":794 * return d.subarray.shape * else: * return () # <<<<<<<<<<<<<< @@ -4569,7 +4552,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ goto __pyx_L0; } - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":803 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":790 * return PyArray_MultiIterNew(5, a, b, c, d, e) * * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<< @@ -4584,7 +4567,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ return __pyx_r; } -/* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":809 +/* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":796 * return () * * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< @@ -4613,7 +4596,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx char *__pyx_t_9; __Pyx_RefNannySetupContext("_util_dtypestring", 0); - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":814 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":801 * * cdef dtype child * cdef int endian_detector = 1 # <<<<<<<<<<<<<< @@ -4622,7 +4605,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ __pyx_v_endian_detector = 1; - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":815 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":802 * cdef dtype child * cdef int endian_detector = 1 * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< @@ -4631,7 +4614,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":818 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":805 * cdef tuple fields * * for childname in descr.names: # <<<<<<<<<<<<<< @@ -4640,21 +4623,21 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ if (unlikely(__pyx_v_descr->names == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(1, 818, __pyx_L1_error) + __PYX_ERR(1, 805, __pyx_L1_error) } __pyx_t_1 = __pyx_v_descr->names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; for (;;) { if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(1, 818, __pyx_L1_error) + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(1, 805, __pyx_L1_error) #else - __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 818, __pyx_L1_error) + __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 805, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3); __pyx_t_3 = 0; - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":819 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":806 * * for childname in descr.names: * fields = descr.fields[childname] # <<<<<<<<<<<<<< @@ -4663,15 +4646,15 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ if (unlikely(__pyx_v_descr->fields == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(1, 819, __pyx_L1_error) + __PYX_ERR(1, 806, __pyx_L1_error) } - __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 819, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 806, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(1, 819, __pyx_L1_error) + if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(1, 806, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3)); __pyx_t_3 = 0; - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":820 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":807 * for childname in descr.names: * fields = descr.fields[childname] * child, new_offset = fields # <<<<<<<<<<<<<< @@ -4680,15 +4663,11 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ if (likely(__pyx_v_fields != Py_None)) { PyObject* sequence = __pyx_v_fields; - #if !CYTHON_COMPILING_IN_PYPY - Py_ssize_t size = Py_SIZE(sequence); - #else - Py_ssize_t size = PySequence_Size(sequence); - #endif + Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(1, 820, __pyx_L1_error) + __PYX_ERR(1, 807, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); @@ -4696,51 +4675,51 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); #else - __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 820, __pyx_L1_error) + __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 807, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 820, __pyx_L1_error) + __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 807, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } else { - __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 820, __pyx_L1_error) + __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 807, __pyx_L1_error) } - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) __PYX_ERR(1, 820, __pyx_L1_error) + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) __PYX_ERR(1, 807, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3)); __pyx_t_3 = 0; __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4); __pyx_t_4 = 0; - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":822 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":809 * child, new_offset = fields * * if (end - f) - (new_offset - offset[0]) < 15: # <<<<<<<<<<<<<< * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") * */ - __pyx_t_4 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 822, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 809, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 822, __pyx_L1_error) + __pyx_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 809, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 822, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 809, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_6 = ((((__pyx_v_end - __pyx_v_f) - ((int)__pyx_t_5)) < 15) != 0); - if (__pyx_t_6) { + if (unlikely(__pyx_t_6)) { - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":823 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":810 * * if (end - f) - (new_offset - offset[0]) < 15: * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<< * * if ((child.byteorder == c'>' and little_endian) or */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 823, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 810, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(1, 823, __pyx_L1_error) + __PYX_ERR(1, 810, __pyx_L1_error) - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":822 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":809 * child, new_offset = fields * * if (end - f) - (new_offset - offset[0]) < 15: # <<<<<<<<<<<<<< @@ -4749,7 +4728,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ } - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":825 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":812 * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") * * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< @@ -4769,7 +4748,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } __pyx_L8_next_or:; - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":826 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":813 * * if ((child.byteorder == c'>' and little_endian) or * (child.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<< @@ -4786,29 +4765,29 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_t_6 = __pyx_t_7; __pyx_L7_bool_binop_done:; - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":825 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":812 * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") * * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< * (child.byteorder == c'<' and not little_endian)): * raise ValueError(u"Non-native byte order not supported") */ - if (__pyx_t_6) { + if (unlikely(__pyx_t_6)) { - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":827 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":814 * if ((child.byteorder == c'>' and little_endian) or * (child.byteorder == c'<' and not little_endian)): * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< * # One could encode it in the format string and have Cython * # complain instead, BUT: < and > in format strings also imply */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 827, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 814, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(1, 827, __pyx_L1_error) + __PYX_ERR(1, 814, __pyx_L1_error) - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":825 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":812 * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") * * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< @@ -4817,7 +4796,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ } - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":837 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":824 * * # Output padding bytes * while offset[0] < new_offset: # <<<<<<<<<<<<<< @@ -4825,15 +4804,15 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx * f += 1 */ while (1) { - __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 837, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 824, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 837, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 824, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 837, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 824, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (!__pyx_t_6) break; - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":838 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":825 * # Output padding bytes * while offset[0] < new_offset: * f[0] = 120 # "x"; pad byte # <<<<<<<<<<<<<< @@ -4842,7 +4821,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ (__pyx_v_f[0]) = 0x78; - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":839 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":826 * while offset[0] < new_offset: * f[0] = 120 # "x"; pad byte * f += 1 # <<<<<<<<<<<<<< @@ -4851,7 +4830,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ __pyx_v_f = (__pyx_v_f + 1); - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":840 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":827 * f[0] = 120 # "x"; pad byte * f += 1 * offset[0] += 1 # <<<<<<<<<<<<<< @@ -4862,7 +4841,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + 1); } - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":842 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":829 * offset[0] += 1 * * offset[0] += child.itemsize # <<<<<<<<<<<<<< @@ -4872,7 +4851,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_t_8 = 0; (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + __pyx_v_child->elsize); - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":844 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":831 * offset[0] += child.itemsize * * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< @@ -4882,19 +4861,19 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0); if (__pyx_t_6) { - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":845 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":832 * * if not PyDataType_HASFIELDS(child): * t = child.type_num # <<<<<<<<<<<<<< * if end - f < 5: * raise RuntimeError(u"Format string allocated too short.") */ - __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_child->type_num); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 845, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_child->type_num); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 832, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_4); __pyx_t_4 = 0; - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":846 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":833 * if not PyDataType_HASFIELDS(child): * t = child.type_num * if end - f < 5: # <<<<<<<<<<<<<< @@ -4902,22 +4881,22 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx * */ __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0); - if (__pyx_t_6) { + if (unlikely(__pyx_t_6)) { - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":847 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":834 * t = child.type_num * if end - f < 5: * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< * * # Until ticket #99 is fixed, use integers to avoid warnings */ - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 847, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 834, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __PYX_ERR(1, 847, __pyx_L1_error) + __PYX_ERR(1, 834, __pyx_L1_error) - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":846 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":833 * if not PyDataType_HASFIELDS(child): * t = child.type_num * if end - f < 5: # <<<<<<<<<<<<<< @@ -4926,252 +4905,252 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ } - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":850 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":837 * * # Until ticket #99 is fixed, use integers to avoid warnings * if t == NPY_BYTE: f[0] = 98 #"b" # <<<<<<<<<<<<<< * elif t == NPY_UBYTE: f[0] = 66 #"B" * elif t == NPY_SHORT: f[0] = 104 #"h" */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_BYTE); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 850, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_BYTE); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 837, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 850, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 837, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 850, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 837, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 98; goto __pyx_L15; } - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":851 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":838 * # Until ticket #99 is fixed, use integers to avoid warnings * if t == NPY_BYTE: f[0] = 98 #"b" * elif t == NPY_UBYTE: f[0] = 66 #"B" # <<<<<<<<<<<<<< * elif t == NPY_SHORT: f[0] = 104 #"h" * elif t == NPY_USHORT: f[0] = 72 #"H" */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UBYTE); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 851, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UBYTE); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 838, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 851, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 838, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 851, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 838, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 66; goto __pyx_L15; } - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":852 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":839 * if t == NPY_BYTE: f[0] = 98 #"b" * elif t == NPY_UBYTE: f[0] = 66 #"B" * elif t == NPY_SHORT: f[0] = 104 #"h" # <<<<<<<<<<<<<< * elif t == NPY_USHORT: f[0] = 72 #"H" * elif t == NPY_INT: f[0] = 105 #"i" */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_SHORT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 852, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_SHORT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 839, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 852, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 839, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 852, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 839, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 0x68; goto __pyx_L15; } - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":853 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":840 * elif t == NPY_UBYTE: f[0] = 66 #"B" * elif t == NPY_SHORT: f[0] = 104 #"h" * elif t == NPY_USHORT: f[0] = 72 #"H" # <<<<<<<<<<<<<< * elif t == NPY_INT: f[0] = 105 #"i" * elif t == NPY_UINT: f[0] = 73 #"I" */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_USHORT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 853, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_USHORT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 840, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 853, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 840, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 853, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 840, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 72; goto __pyx_L15; } - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":854 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":841 * elif t == NPY_SHORT: f[0] = 104 #"h" * elif t == NPY_USHORT: f[0] = 72 #"H" * elif t == NPY_INT: f[0] = 105 #"i" # <<<<<<<<<<<<<< * elif t == NPY_UINT: f[0] = 73 #"I" * elif t == NPY_LONG: f[0] = 108 #"l" */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_INT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 854, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_INT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 841, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 854, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 841, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 854, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 841, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 0x69; goto __pyx_L15; } - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":855 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":842 * elif t == NPY_USHORT: f[0] = 72 #"H" * elif t == NPY_INT: f[0] = 105 #"i" * elif t == NPY_UINT: f[0] = 73 #"I" # <<<<<<<<<<<<<< * elif t == NPY_LONG: f[0] = 108 #"l" * elif t == NPY_ULONG: f[0] = 76 #"L" */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UINT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 855, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UINT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 842, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 855, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 842, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 855, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 842, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 73; goto __pyx_L15; } - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":856 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":843 * elif t == NPY_INT: f[0] = 105 #"i" * elif t == NPY_UINT: f[0] = 73 #"I" * elif t == NPY_LONG: f[0] = 108 #"l" # <<<<<<<<<<<<<< * elif t == NPY_ULONG: f[0] = 76 #"L" * elif t == NPY_LONGLONG: f[0] = 113 #"q" */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 856, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 843, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 856, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 843, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 856, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 843, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 0x6C; goto __pyx_L15; } - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":857 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":844 * elif t == NPY_UINT: f[0] = 73 #"I" * elif t == NPY_LONG: f[0] = 108 #"l" * elif t == NPY_ULONG: f[0] = 76 #"L" # <<<<<<<<<<<<<< * elif t == NPY_LONGLONG: f[0] = 113 #"q" * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 857, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 844, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 857, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 844, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 857, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 844, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 76; goto __pyx_L15; } - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":858 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":845 * elif t == NPY_LONG: f[0] = 108 #"l" * elif t == NPY_ULONG: f[0] = 76 #"L" * elif t == NPY_LONGLONG: f[0] = 113 #"q" # <<<<<<<<<<<<<< * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" * elif t == NPY_FLOAT: f[0] = 102 #"f" */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGLONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 858, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGLONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 845, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 858, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 845, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 858, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 845, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 0x71; goto __pyx_L15; } - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":859 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":846 * elif t == NPY_ULONG: f[0] = 76 #"L" * elif t == NPY_LONGLONG: f[0] = 113 #"q" * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" # <<<<<<<<<<<<<< * elif t == NPY_FLOAT: f[0] = 102 #"f" * elif t == NPY_DOUBLE: f[0] = 100 #"d" */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONGLONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 859, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONGLONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 846, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 859, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 846, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 859, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 846, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 81; goto __pyx_L15; } - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":860 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":847 * elif t == NPY_LONGLONG: f[0] = 113 #"q" * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" * elif t == NPY_FLOAT: f[0] = 102 #"f" # <<<<<<<<<<<<<< * elif t == NPY_DOUBLE: f[0] = 100 #"d" * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_FLOAT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 860, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_FLOAT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 847, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 860, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 847, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 860, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 847, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 0x66; goto __pyx_L15; } - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":861 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":848 * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" * elif t == NPY_FLOAT: f[0] = 102 #"f" * elif t == NPY_DOUBLE: f[0] = 100 #"d" # <<<<<<<<<<<<<< * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_DOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 861, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_DOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 848, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 861, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 848, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 861, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 848, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 0x64; goto __pyx_L15; } - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":862 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":849 * elif t == NPY_FLOAT: f[0] = 102 #"f" * elif t == NPY_DOUBLE: f[0] = 100 #"d" * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" # <<<<<<<<<<<<<< * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 862, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 849, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 862, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 849, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 862, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 849, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 0x67; goto __pyx_L15; } - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":863 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":850 * elif t == NPY_DOUBLE: f[0] = 100 #"d" * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf # <<<<<<<<<<<<<< * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CFLOAT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 863, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CFLOAT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 850, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 863, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 850, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 863, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 850, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 90; @@ -5180,18 +5159,18 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":864 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":851 * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd # <<<<<<<<<<<<<< * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg * elif t == NPY_OBJECT: f[0] = 79 #"O" */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 864, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 851, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 864, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 851, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 864, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 851, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 90; @@ -5200,18 +5179,18 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":865 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":852 * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg # <<<<<<<<<<<<<< * elif t == NPY_OBJECT: f[0] = 79 #"O" * else: */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 865, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 852, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 865, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 852, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 865, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 852, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 90; @@ -5220,25 +5199,25 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":866 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":853 * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg * elif t == NPY_OBJECT: f[0] = 79 #"O" # <<<<<<<<<<<<<< * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_OBJECT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 866, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_OBJECT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 853, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 866, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 853, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 866, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 853, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { + if (likely(__pyx_t_6)) { (__pyx_v_f[0]) = 79; goto __pyx_L15; } - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":868 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":855 * elif t == NPY_OBJECT: f[0] = 79 #"O" * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< @@ -5246,23 +5225,18 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx * else: */ /*else*/ { - __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 868, __pyx_L1_error) + __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 855, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 868, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 855, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_GIVEREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); - __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 868, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(1, 868, __pyx_L1_error) + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __PYX_ERR(1, 855, __pyx_L1_error) } __pyx_L15:; - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":869 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":856 * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) * f += 1 # <<<<<<<<<<<<<< @@ -5271,7 +5245,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ __pyx_v_f = (__pyx_v_f + 1); - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":844 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":831 * offset[0] += child.itemsize * * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< @@ -5281,7 +5255,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L13; } - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":873 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":860 * # Cython ignores struct boundary information ("T{...}"), * # so don't output it * f = _util_dtypestring(child, f, end, offset) # <<<<<<<<<<<<<< @@ -5289,12 +5263,12 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx * */ /*else*/ { - __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_9 == ((char *)NULL))) __PYX_ERR(1, 873, __pyx_L1_error) + __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_9 == ((char *)NULL))) __PYX_ERR(1, 860, __pyx_L1_error) __pyx_v_f = __pyx_t_9; } __pyx_L13:; - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":818 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":805 * cdef tuple fields * * for childname in descr.names: # <<<<<<<<<<<<<< @@ -5304,7 +5278,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":874 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":861 * # so don't output it * f = _util_dtypestring(child, f, end, offset) * return f # <<<<<<<<<<<<<< @@ -5314,7 +5288,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_r = __pyx_v_f; goto __pyx_L0; - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":809 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":796 * return () * * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< @@ -5339,7 +5313,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx return __pyx_r; } -/* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":990 +/* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":977 * * * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< @@ -5354,7 +5328,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a int __pyx_t_2; __Pyx_RefNannySetupContext("set_array_base", 0); - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":992 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":979 * cdef inline void set_array_base(ndarray arr, object base): * cdef PyObject* baseptr * if base is None: # <<<<<<<<<<<<<< @@ -5365,7 +5339,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":993 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":980 * cdef PyObject* baseptr * if base is None: * baseptr = NULL # <<<<<<<<<<<<<< @@ -5374,7 +5348,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a */ __pyx_v_baseptr = NULL; - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":992 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":979 * cdef inline void set_array_base(ndarray arr, object base): * cdef PyObject* baseptr * if base is None: # <<<<<<<<<<<<<< @@ -5384,7 +5358,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a goto __pyx_L3; } - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":995 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":982 * baseptr = NULL * else: * Py_INCREF(base) # important to do this before decref below! # <<<<<<<<<<<<<< @@ -5394,7 +5368,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a /*else*/ { Py_INCREF(__pyx_v_base); - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":996 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":983 * else: * Py_INCREF(base) # important to do this before decref below! * baseptr = base # <<<<<<<<<<<<<< @@ -5405,7 +5379,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a } __pyx_L3:; - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":997 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":984 * Py_INCREF(base) # important to do this before decref below! * baseptr = base * Py_XDECREF(arr.base) # <<<<<<<<<<<<<< @@ -5414,7 +5388,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a */ Py_XDECREF(__pyx_v_arr->base); - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":998 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":985 * baseptr = base * Py_XDECREF(arr.base) * arr.base = baseptr # <<<<<<<<<<<<<< @@ -5423,7 +5397,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a */ __pyx_v_arr->base = __pyx_v_baseptr; - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":990 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":977 * * * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< @@ -5435,7 +5409,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a __Pyx_RefNannyFinishContext(); } -/* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1000 +/* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":987 * arr.base = baseptr * * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< @@ -5449,7 +5423,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py int __pyx_t_1; __Pyx_RefNannySetupContext("get_array_base", 0); - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1001 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":988 * * cdef inline object get_array_base(ndarray arr): * if arr.base is NULL: # <<<<<<<<<<<<<< @@ -5459,7 +5433,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py __pyx_t_1 = ((__pyx_v_arr->base == NULL) != 0); if (__pyx_t_1) { - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1002 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":989 * cdef inline object get_array_base(ndarray arr): * if arr.base is NULL: * return None # <<<<<<<<<<<<<< @@ -5467,11 +5441,10 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py * return arr.base */ __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(Py_None); - __pyx_r = Py_None; + __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1001 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":988 * * cdef inline object get_array_base(ndarray arr): * if arr.base is NULL: # <<<<<<<<<<<<<< @@ -5480,7 +5453,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py */ } - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1004 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":991 * return None * else: * return arr.base # <<<<<<<<<<<<<< @@ -5494,7 +5467,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py goto __pyx_L0; } - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1000 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":987 * arr.base = baseptr * * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< @@ -5509,7 +5482,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py return __pyx_r; } -/* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1009 +/* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":996 * # Versions of the import_* functions which are more suitable for * # Cython code. * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< @@ -5530,7 +5503,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { PyObject *__pyx_t_8 = NULL; __Pyx_RefNannySetupContext("import_array", 0); - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1010 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":997 * # Cython code. * cdef inline int import_array() except -1: * try: # <<<<<<<<<<<<<< @@ -5546,16 +5519,16 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1011 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":998 * cdef inline int import_array() except -1: * try: * _import_array() # <<<<<<<<<<<<<< * except Exception: * raise ImportError("numpy.core.multiarray failed to import") */ - __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 1011, __pyx_L3_error) + __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 998, __pyx_L3_error) - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1010 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":997 * # Cython code. * cdef inline int import_array() except -1: * try: # <<<<<<<<<<<<<< @@ -5569,7 +5542,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { goto __pyx_L8_try_end; __pyx_L3_error:; - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1012 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":999 * try: * _import_array() * except Exception: # <<<<<<<<<<<<<< @@ -5579,28 +5552,28 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { __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(1, 1012, __pyx_L5_except_error) + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 999, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GOTREF(__pyx_t_6); __Pyx_GOTREF(__pyx_t_7); - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1013 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1000 * _import_array() * except Exception: * 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(1, 1013, __pyx_L5_except_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1000, __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(1, 1013, __pyx_L5_except_error) + __PYX_ERR(1, 1000, __pyx_L5_except_error) } goto __pyx_L5_except_error; __pyx_L5_except_error:; - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1010 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":997 * # Cython code. * cdef inline int import_array() except -1: * try: # <<<<<<<<<<<<<< @@ -5615,7 +5588,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { __pyx_L8_try_end:; } - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1009 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":996 * # Versions of the import_* functions which are more suitable for * # Cython code. * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< @@ -5638,7 +5611,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { return __pyx_r; } -/* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1015 +/* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1002 * raise ImportError("numpy.core.multiarray failed to import") * * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< @@ -5659,7 +5632,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { PyObject *__pyx_t_8 = NULL; __Pyx_RefNannySetupContext("import_umath", 0); - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1016 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1003 * * cdef inline int import_umath() except -1: * try: # <<<<<<<<<<<<<< @@ -5675,16 +5648,16 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1017 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1004 * cdef inline int import_umath() except -1: * try: * _import_umath() # <<<<<<<<<<<<<< * except Exception: * raise ImportError("numpy.core.umath failed to import") */ - __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 1017, __pyx_L3_error) + __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 1004, __pyx_L3_error) - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1016 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1003 * * cdef inline int import_umath() except -1: * try: # <<<<<<<<<<<<<< @@ -5698,7 +5671,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { goto __pyx_L8_try_end; __pyx_L3_error:; - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1018 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1005 * try: * _import_umath() * except Exception: # <<<<<<<<<<<<<< @@ -5708,28 +5681,28 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { __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(1, 1018, __pyx_L5_except_error) + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 1005, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GOTREF(__pyx_t_6); __Pyx_GOTREF(__pyx_t_7); - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1019 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1006 * _import_umath() * except Exception: * 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(1, 1019, __pyx_L5_except_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1006, __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(1, 1019, __pyx_L5_except_error) + __PYX_ERR(1, 1006, __pyx_L5_except_error) } goto __pyx_L5_except_error; __pyx_L5_except_error:; - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1016 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1003 * * cdef inline int import_umath() except -1: * try: # <<<<<<<<<<<<<< @@ -5744,7 +5717,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { __pyx_L8_try_end:; } - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1015 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1002 * raise ImportError("numpy.core.multiarray failed to import") * * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< @@ -5767,7 +5740,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { return __pyx_r; } -/* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1021 +/* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1008 * raise ImportError("numpy.core.umath failed to import") * * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< @@ -5788,7 +5761,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { PyObject *__pyx_t_8 = NULL; __Pyx_RefNannySetupContext("import_ufunc", 0); - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1022 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1009 * * cdef inline int import_ufunc() except -1: * try: # <<<<<<<<<<<<<< @@ -5804,16 +5777,16 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1023 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1010 * cdef inline int import_ufunc() except -1: * try: * _import_umath() # <<<<<<<<<<<<<< * except Exception: * raise ImportError("numpy.core.umath failed to import") */ - __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 1023, __pyx_L3_error) + __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 1010, __pyx_L3_error) - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1022 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1009 * * cdef inline int import_ufunc() except -1: * try: # <<<<<<<<<<<<<< @@ -5827,7 +5800,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { goto __pyx_L8_try_end; __pyx_L3_error:; - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1024 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1011 * try: * _import_umath() * except Exception: # <<<<<<<<<<<<<< @@ -5836,26 +5809,26 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { __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(1, 1024, __pyx_L5_except_error) + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 1011, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GOTREF(__pyx_t_6); __Pyx_GOTREF(__pyx_t_7); - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1025 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1012 * _import_umath() * except Exception: * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< */ - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1025, __pyx_L5_except_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1012, __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(1, 1025, __pyx_L5_except_error) + __PYX_ERR(1, 1012, __pyx_L5_except_error) } goto __pyx_L5_except_error; __pyx_L5_except_error:; - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1022 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1009 * * cdef inline int import_ufunc() except -1: * try: # <<<<<<<<<<<<<< @@ -5870,7 +5843,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { __pyx_L8_try_end:; } - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1021 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1008 * raise ImportError("numpy.core.umath failed to import") * * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< @@ -5981,11 +5954,11 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {0, 0, 0, 0, 0, 0, 0} }; static int __Pyx_InitCachedBuiltins(void) { - __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(0, 14, __pyx_L1_error) - __pyx_builtin_IOError = __Pyx_GetBuiltinName(__pyx_n_s_IOError); if (!__pyx_builtin_IOError) __PYX_ERR(0, 66, __pyx_L1_error) - __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 100, __pyx_L1_error) - __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(1, 235, __pyx_L1_error) - __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(1, 823, __pyx_L1_error) + __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(0, 16, __pyx_L1_error) + __pyx_builtin_IOError = __Pyx_GetBuiltinName(__pyx_n_s_IOError); if (!__pyx_builtin_IOError) __PYX_ERR(0, 79, __pyx_L1_error) + __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 113, __pyx_L1_error) + __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(1, 229, __pyx_L1_error) + __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(1, 810, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; @@ -5995,148 +5968,148 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); - /* "pyndl/ndl_parallel.pyx":50 + /* "pyndl/ndl_parallel.pyx":63 * * for binary_file_path in binary_file_paths: # * filename_byte_string = binary_file_path.encode("UTF-8") # <<<<<<<<<<<<<< * fname = filename_byte_string * */ - __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_UTF_8); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 50, __pyx_L1_error) + __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_UTF_8); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple_); __Pyx_GIVEREF(__pyx_tuple_); - /* "pyndl/ndl_parallel.pyx":86 + /* "pyndl/ndl_parallel.pyx":99 * * for binary_file_path in binary_file_paths: # * filename_byte_string = binary_file_path.encode("UTF-8") # <<<<<<<<<<<<<< * fname = filename_byte_string * */ - __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_UTF_8); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 86, __pyx_L1_error) + __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_UTF_8); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 99, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__2); __Pyx_GIVEREF(__pyx_tuple__2); - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":235 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":229 * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<< * * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) */ - __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(1, 235, __pyx_L1_error) + __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(1, 229, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__3); __Pyx_GIVEREF(__pyx_tuple__3); - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":239 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":233 * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<< * * info.buf = PyArray_DATA(self) */ - __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(1, 239, __pyx_L1_error) + __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(1, 233, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__4); __Pyx_GIVEREF(__pyx_tuple__4); - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":276 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":263 * if ((descr.byteorder == c'>' and little_endian) or * (descr.byteorder == c'<' and not little_endian)): * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< * if t == NPY_BYTE: f = "b" * elif t == NPY_UBYTE: f = "B" */ - __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(1, 276, __pyx_L1_error) + __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(1, 263, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__5); __Pyx_GIVEREF(__pyx_tuple__5); - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":823 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":810 * * if (end - f) - (new_offset - offset[0]) < 15: * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<< * * if ((child.byteorder == c'>' and little_endian) or */ - __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(1, 823, __pyx_L1_error) + __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(1, 810, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__6); __Pyx_GIVEREF(__pyx_tuple__6); - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":827 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":814 * if ((child.byteorder == c'>' and little_endian) or * (child.byteorder == c'<' and not little_endian)): * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< * # One could encode it in the format string and have Cython * # complain instead, BUT: < and > in format strings also imply */ - __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(1, 827, __pyx_L1_error) + __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(1, 814, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__7); __Pyx_GIVEREF(__pyx_tuple__7); - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":847 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":834 * t = child.type_num * if end - f < 5: * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< * * # Until ticket #99 is fixed, use integers to avoid warnings */ - __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(1, 847, __pyx_L1_error) + __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(1, 834, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__8); __Pyx_GIVEREF(__pyx_tuple__8); - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1013 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1000 * _import_array() * except Exception: * 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(1, 1013, __pyx_L1_error) + __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(1, 1000, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__9); __Pyx_GIVEREF(__pyx_tuple__9); - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1019 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1006 * _import_umath() * except Exception: * 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(1, 1019, __pyx_L1_error) + __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(1, 1006, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__10); __Pyx_GIVEREF(__pyx_tuple__10); - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1025 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1012 * _import_umath() * except Exception: * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< */ - __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(1, 1025, __pyx_L1_error) + __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(1, 1012, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__11); __Pyx_GIVEREF(__pyx_tuple__11); - /* "pyndl/ndl_parallel.pyx":30 + /* "pyndl/ndl_parallel.pyx":43 * * * def learn_inplace(binary_file_paths, np.ndarray[dtype_t, ndim=2] weights, # <<<<<<<<<<<<<< * dtype_t alpha, dtype_t beta1, * dtype_t beta2, dtype_t lambda_, */ - __pyx_tuple__12 = PyTuple_Pack(21, __pyx_n_s_binary_file_paths, __pyx_n_s_weights, __pyx_n_s_alpha, __pyx_n_s_beta1, __pyx_n_s_beta2, __pyx_n_s_lambda, __pyx_n_s_all_outcomes, __pyx_n_s_chunksize, __pyx_n_s_number_of_threads, __pyx_n_s_mm, __pyx_n_s_all_outcomes_ptr, __pyx_n_s_length_all_outcomes, __pyx_n_s_fname, __pyx_n_s_start_val, __pyx_n_s_end_val, __pyx_n_s_ii, __pyx_n_s_number_parts, __pyx_n_s_error, __pyx_n_s_weights_ptr, __pyx_n_s_binary_file_path, __pyx_n_s_filename_byte_string); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 30, __pyx_L1_error) + __pyx_tuple__12 = PyTuple_Pack(21, __pyx_n_s_binary_file_paths, __pyx_n_s_weights, __pyx_n_s_alpha, __pyx_n_s_beta1, __pyx_n_s_beta2, __pyx_n_s_lambda, __pyx_n_s_all_outcomes, __pyx_n_s_chunksize, __pyx_n_s_number_of_threads, __pyx_n_s_mm, __pyx_n_s_all_outcomes_ptr, __pyx_n_s_length_all_outcomes, __pyx_n_s_fname, __pyx_n_s_start_val, __pyx_n_s_end_val, __pyx_n_s_ii, __pyx_n_s_number_parts, __pyx_n_s_error, __pyx_n_s_weights_ptr, __pyx_n_s_binary_file_path, __pyx_n_s_filename_byte_string); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 43, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__12); __Pyx_GIVEREF(__pyx_tuple__12); - __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(9, 0, 21, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__12, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyndl_ndl_parallel_pyx, __pyx_n_s_learn_inplace, 30, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) __PYX_ERR(0, 30, __pyx_L1_error) + __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(9, 0, 21, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__12, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyndl_ndl_parallel_pyx, __pyx_n_s_learn_inplace, 43, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) __PYX_ERR(0, 43, __pyx_L1_error) - /* "pyndl/ndl_parallel.pyx":68 + /* "pyndl/ndl_parallel.pyx":81 * raise IOError('binary files does not have proper format, error code %i' % error) * * def learn_inplace_2(binary_file_paths, np.ndarray[dtype_t, ndim=2] weights, # <<<<<<<<<<<<<< * dtype_t alpha, dtype_t beta1, * dtype_t beta2, dtype_t lambda_, */ - __pyx_tuple__14 = PyTuple_Pack(17, __pyx_n_s_binary_file_paths, __pyx_n_s_weights, __pyx_n_s_alpha, __pyx_n_s_beta1, __pyx_n_s_beta2, __pyx_n_s_lambda, __pyx_n_s_all_outcomes, __pyx_n_s_mm, __pyx_n_s_all_outcomes_ptr, __pyx_n_s_length_all_outcomes, __pyx_n_s_fname, __pyx_n_s_start_val, __pyx_n_s_end_val, __pyx_n_s_error, __pyx_n_s_weights_ptr, __pyx_n_s_binary_file_path, __pyx_n_s_filename_byte_string); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(0, 68, __pyx_L1_error) + __pyx_tuple__14 = PyTuple_Pack(17, __pyx_n_s_binary_file_paths, __pyx_n_s_weights, __pyx_n_s_alpha, __pyx_n_s_beta1, __pyx_n_s_beta2, __pyx_n_s_lambda, __pyx_n_s_all_outcomes, __pyx_n_s_mm, __pyx_n_s_all_outcomes_ptr, __pyx_n_s_length_all_outcomes, __pyx_n_s_fname, __pyx_n_s_start_val, __pyx_n_s_end_val, __pyx_n_s_error, __pyx_n_s_weights_ptr, __pyx_n_s_binary_file_path, __pyx_n_s_filename_byte_string); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(0, 81, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__14); __Pyx_GIVEREF(__pyx_tuple__14); - __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(7, 0, 17, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__14, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyndl_ndl_parallel_pyx, __pyx_n_s_learn_inplace_2, 68, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) __PYX_ERR(0, 68, __pyx_L1_error) + __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(7, 0, 17, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__14, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyndl_ndl_parallel_pyx, __pyx_n_s_learn_inplace_2, 81, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) __PYX_ERR(0, 81, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; @@ -6153,17 +6126,122 @@ PyEval_InitThreads(); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + __pyx_int_18446744069414584320 = PyInt_FromString((char *)"18446744069414584320", 0, 0); if (unlikely(!__pyx_int_18446744069414584320)) __PYX_ERR(0, 1, __pyx_L1_error) + return 0; + __pyx_L1_error:; + return -1; +} + +static int __Pyx_modinit_global_init_code(void); /*proto*/ +static int __Pyx_modinit_variable_export_code(void); /*proto*/ +static int __Pyx_modinit_function_export_code(void); /*proto*/ +static int __Pyx_modinit_type_init_code(void); /*proto*/ +static int __Pyx_modinit_type_import_code(void); /*proto*/ +static int __Pyx_modinit_variable_import_code(void); /*proto*/ +static int __Pyx_modinit_function_import_code(void); /*proto*/ + +static int __Pyx_modinit_global_init_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); + /*--- Global init code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_variable_export_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); + /*--- Variable export code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_function_export_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); + /*--- Function export code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_type_init_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); + /*--- Type init code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_type_import_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); + /*--- Type import code ---*/ + __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "type", + #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000 + sizeof(PyTypeObject), + #else + sizeof(PyHeapTypeObject), + #endif + 0); if (unlikely(!__pyx_ptype_7cpython_4type_type)) __PYX_ERR(2, 9, __pyx_L1_error) + __pyx_ptype_5numpy_dtype = __Pyx_ImportType("numpy", "dtype", sizeof(PyArray_Descr), 0); if (unlikely(!__pyx_ptype_5numpy_dtype)) __PYX_ERR(1, 164, __pyx_L1_error) + __pyx_ptype_5numpy_flatiter = __Pyx_ImportType("numpy", "flatiter", sizeof(PyArrayIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_flatiter)) __PYX_ERR(1, 186, __pyx_L1_error) + __pyx_ptype_5numpy_broadcast = __Pyx_ImportType("numpy", "broadcast", sizeof(PyArrayMultiIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_broadcast)) __PYX_ERR(1, 190, __pyx_L1_error) + __pyx_ptype_5numpy_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject), 0); if (unlikely(!__pyx_ptype_5numpy_ndarray)) __PYX_ERR(1, 199, __pyx_L1_error) + __pyx_ptype_5numpy_ufunc = __Pyx_ImportType("numpy", "ufunc", sizeof(PyUFuncObject), 0); if (unlikely(!__pyx_ptype_5numpy_ufunc)) __PYX_ERR(1, 872, __pyx_L1_error) + __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); return -1; } +static int __Pyx_modinit_variable_import_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); + /*--- Variable import code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_function_import_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); + /*--- Function import code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + + +#if PY_MAJOR_VERSION < 3 +#ifdef CYTHON_NO_PYINIT_EXPORT +#define __Pyx_PyMODINIT_FUNC void +#else +#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC +#endif +#else +#ifdef CYTHON_NO_PYINIT_EXPORT +#define __Pyx_PyMODINIT_FUNC PyObject * +#else +#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC +#endif +#endif +#ifndef CYTHON_SMALL_CODE +#if defined(__clang__) + #define CYTHON_SMALL_CODE +#elif defined(__GNUC__) + #define CYTHON_SMALL_CODE __attribute__((optimize("Os"))) +#else + #define CYTHON_SMALL_CODE +#endif +#endif + + #if PY_MAJOR_VERSION < 3 -PyMODINIT_FUNC initndl_parallel(void); /*proto*/ -PyMODINIT_FUNC initndl_parallel(void) +__Pyx_PyMODINIT_FUNC initndl_parallel(void) CYTHON_SMALL_CODE; /*proto*/ +__Pyx_PyMODINIT_FUNC initndl_parallel(void) #else -PyMODINIT_FUNC PyInit_ndl_parallel(void); /*proto*/ -PyMODINIT_FUNC PyInit_ndl_parallel(void) +__Pyx_PyMODINIT_FUNC PyInit_ndl_parallel(void) CYTHON_SMALL_CODE; /*proto*/ +__Pyx_PyMODINIT_FUNC PyInit_ndl_parallel(void) #if CYTHON_PEP489_MULTI_PHASE_INIT { return PyModuleDef_Init(&__pyx_moduledef); @@ -6213,17 +6291,19 @@ static int __pyx_pymod_exec_ndl_parallel(PyObject *__pyx_pyinit_module) __Pyx_RefNannyDeclarations #if CYTHON_PEP489_MULTI_PHASE_INIT if (__pyx_m && __pyx_m == __pyx_pyinit_module) return 0; + #elif PY_MAJOR_VERSION >= 3 + if (__pyx_m) return __Pyx_NewRef(__pyx_m); #endif #if CYTHON_REFNANNY - __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); - if (!__Pyx_RefNanny) { - PyErr_Clear(); - __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); - if (!__Pyx_RefNanny) - Py_FatalError("failed to import 'refnanny' module"); - } - #endif - __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_ndl_parallel(void)", 0); +__Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); +if (!__Pyx_RefNanny) { + PyErr_Clear(); + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); + if (!__Pyx_RefNanny) + Py_FatalError("failed to import 'refnanny' module"); +} +#endif + __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_ndl_parallel(void)", 0); if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) @@ -6293,25 +6373,14 @@ static int __pyx_pymod_exec_ndl_parallel(PyObject *__pyx_pyinit_module) if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Constants init code ---*/ if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - /*--- Global init code ---*/ - /*--- Variable export code ---*/ - /*--- Function export code ---*/ - /*--- Type init code ---*/ - /*--- Type import code ---*/ - __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "type", - #if CYTHON_COMPILING_IN_PYPY - sizeof(PyTypeObject), - #else - sizeof(PyHeapTypeObject), - #endif - 0); if (unlikely(!__pyx_ptype_7cpython_4type_type)) __PYX_ERR(2, 9, __pyx_L1_error) - __pyx_ptype_5numpy_dtype = __Pyx_ImportType("numpy", "dtype", sizeof(PyArray_Descr), 0); if (unlikely(!__pyx_ptype_5numpy_dtype)) __PYX_ERR(1, 163, __pyx_L1_error) - __pyx_ptype_5numpy_flatiter = __Pyx_ImportType("numpy", "flatiter", sizeof(PyArrayIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_flatiter)) __PYX_ERR(1, 185, __pyx_L1_error) - __pyx_ptype_5numpy_broadcast = __Pyx_ImportType("numpy", "broadcast", sizeof(PyArrayMultiIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_broadcast)) __PYX_ERR(1, 189, __pyx_L1_error) - __pyx_ptype_5numpy_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject), 0); if (unlikely(!__pyx_ptype_5numpy_ndarray)) __PYX_ERR(1, 198, __pyx_L1_error) - __pyx_ptype_5numpy_ufunc = __Pyx_ImportType("numpy", "ufunc", sizeof(PyUFuncObject), 0); if (unlikely(!__pyx_ptype_5numpy_ufunc)) __PYX_ERR(1, 885, __pyx_L1_error) - /*--- Variable import code ---*/ - /*--- Function import code ---*/ + /*--- Global type/function init code ---*/ + (void)__Pyx_modinit_global_init_code(); + (void)__Pyx_modinit_variable_export_code(); + (void)__Pyx_modinit_function_export_code(); + (void)__Pyx_modinit_type_init_code(); + if (unlikely(__Pyx_modinit_type_import_code() != 0)) goto __pyx_L1_error; + (void)__Pyx_modinit_variable_import_code(); + (void)__Pyx_modinit_function_import_code(); /*--- Execution code ---*/ #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) @@ -6350,75 +6419,130 @@ static int __pyx_pymod_exec_ndl_parallel(PyObject *__pyx_pyinit_module) * cdef unsigned int CURRENT_VERSION_WITH_FREQ = 215 * cdef unsigned int CURRENT_VERSION = 2048 + 215 # <<<<<<<<<<<<<< * - * if sizeof(unsigned int) != 4: + * # run two sanity checks while loading the extension */ __pyx_v_5pyndl_12ndl_parallel_CURRENT_VERSION = 0x8D7; - /* "pyndl/ndl_parallel.pyx":13 - * cdef unsigned int CURRENT_VERSION = 2048 + 215 - * + /* "pyndl/ndl_parallel.pyx":15 + * # run two sanity checks while loading the extension + * # 1. check * if sizeof(unsigned int) != 4: # <<<<<<<<<<<<<< * raise ImportError('unsigned int needs to be 4 bytes not %i bytes' % sizeof(unsigned int)) * */ __pyx_t_2 = (((sizeof(unsigned int)) != 4) != 0); - if (__pyx_t_2) { + if (unlikely(__pyx_t_2)) { - /* "pyndl/ndl_parallel.pyx":14 - * + /* "pyndl/ndl_parallel.pyx":16 + * # 1. check * if sizeof(unsigned int) != 4: * raise ImportError('unsigned int needs to be 4 bytes not %i bytes' % sizeof(unsigned int)) # <<<<<<<<<<<<<< * - * + * # 2. check */ - __pyx_t_1 = __Pyx_PyInt_FromSize_t((sizeof(unsigned int))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 14, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_FromSize_t((sizeof(unsigned int))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 16, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_unsigned_int_needs_to_be_4_bytes, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 14, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_unsigned_int_needs_to_be_4_bytes, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 16, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 14, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ImportError, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 16, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_GIVEREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); - __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 14, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(0, 14, __pyx_L1_error) + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 16, __pyx_L1_error) - /* "pyndl/ndl_parallel.pyx":13 - * cdef unsigned int CURRENT_VERSION = 2048 + 215 - * + /* "pyndl/ndl_parallel.pyx":15 + * # run two sanity checks while loading the extension + * # 1. check * if sizeof(unsigned int) != 4: # <<<<<<<<<<<<<< * raise ImportError('unsigned int needs to be 4 bytes not %i bytes' % sizeof(unsigned int)) * */ } - /* "pyndl/ndl_parallel.pyx":30 + /* "pyndl/ndl_parallel.pyx":22 + * cdef unsigned long long test_index + * cdef unsigned int test_cue_index, test_mm, test_outcome_index + * test_cue_index = test_mm = test_outcome_index = 4294967295 # <<<<<<<<<<<<<< + * + * test_index = test_mm + */ + __pyx_v_5pyndl_12ndl_parallel_test_cue_index = 0xFFFFFFFF; + __pyx_v_5pyndl_12ndl_parallel_test_mm = 0xFFFFFFFF; + __pyx_v_5pyndl_12ndl_parallel_test_outcome_index = 0xFFFFFFFF; + + /* "pyndl/ndl_parallel.pyx":24 + * test_cue_index = test_mm = test_outcome_index = 4294967295 + * + * test_index = test_mm # <<<<<<<<<<<<<< + * test_index *= test_outcome_index + * test_index += test_cue_index + */ + __pyx_v_5pyndl_12ndl_parallel_test_index = __pyx_v_5pyndl_12ndl_parallel_test_mm; + + /* "pyndl/ndl_parallel.pyx":25 + * + * test_index = test_mm + * test_index *= test_outcome_index # <<<<<<<<<<<<<< + * test_index += test_cue_index + * assert test_index == 18446744069414584320 + */ + __pyx_v_5pyndl_12ndl_parallel_test_index = (__pyx_v_5pyndl_12ndl_parallel_test_index * __pyx_v_5pyndl_12ndl_parallel_test_outcome_index); + + /* "pyndl/ndl_parallel.pyx":26 + * test_index = test_mm + * test_index *= test_outcome_index + * test_index += test_cue_index # <<<<<<<<<<<<<< + * assert test_index == 18446744069414584320 + * + */ + __pyx_v_5pyndl_12ndl_parallel_test_index = (__pyx_v_5pyndl_12ndl_parallel_test_index + __pyx_v_5pyndl_12ndl_parallel_test_cue_index); + + /* "pyndl/ndl_parallel.pyx":27 + * test_index *= test_outcome_index + * test_index += test_cue_index + * assert test_index == 18446744069414584320 # <<<<<<<<<<<<<< + * + * + */ + #ifndef CYTHON_WITHOUT_ASSERTIONS + if (unlikely(!Py_OptimizeFlag)) { + __pyx_t_1 = __Pyx_PyInt_From_unsigned_PY_LONG_LONG(__pyx_v_5pyndl_12ndl_parallel_test_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 27, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_int_18446744069414584320, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 27, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 27, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_2)) { + PyErr_SetNone(PyExc_AssertionError); + __PYX_ERR(0, 27, __pyx_L1_error) + } + } + #endif + + /* "pyndl/ndl_parallel.pyx":43 * * * def learn_inplace(binary_file_paths, np.ndarray[dtype_t, ndim=2] weights, # <<<<<<<<<<<<<< * dtype_t alpha, dtype_t beta1, * dtype_t beta2, dtype_t lambda_, */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5pyndl_12ndl_parallel_1learn_inplace, NULL, __pyx_n_s_pyndl_ndl_parallel); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 30, __pyx_L1_error) + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5pyndl_12ndl_parallel_1learn_inplace, NULL, __pyx_n_s_pyndl_ndl_parallel); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 43, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_learn_inplace, __pyx_t_3) < 0) __PYX_ERR(0, 30, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_learn_inplace, __pyx_t_3) < 0) __PYX_ERR(0, 43, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "pyndl/ndl_parallel.pyx":68 + /* "pyndl/ndl_parallel.pyx":81 * raise IOError('binary files does not have proper format, error code %i' % error) * * def learn_inplace_2(binary_file_paths, np.ndarray[dtype_t, ndim=2] weights, # <<<<<<<<<<<<<< * dtype_t alpha, dtype_t beta1, * dtype_t beta2, dtype_t lambda_, */ - __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5pyndl_12ndl_parallel_3learn_inplace_2, NULL, __pyx_n_s_pyndl_ndl_parallel); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 68, __pyx_L1_error) + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_5pyndl_12ndl_parallel_3learn_inplace_2, NULL, __pyx_n_s_pyndl_ndl_parallel); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 81, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_learn_inplace_2, __pyx_t_3) < 0) __PYX_ERR(0, 68, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_learn_inplace_2, __pyx_t_3) < 0) __PYX_ERR(0, 81, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pyndl/ndl_parallel.pyx":1 @@ -6431,7 +6555,7 @@ static int __pyx_pymod_exec_ndl_parallel(PyObject *__pyx_pyinit_module) if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_3) < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "../../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1021 + /* "../../../../miniconda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1008 * raise ImportError("numpy.core.umath failed to import") * * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< @@ -6482,6 +6606,20 @@ static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { } #endif +/* PyObjectGetAttrStr */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_getattro)) + return tp->tp_getattro(obj, attr_name); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_getattr)) + return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); +#endif + return PyObject_GetAttr(obj, attr_name); +} +#endif + /* GetBuiltinName */ static PyObject *__Pyx_GetBuiltinName(PyObject *name) { PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); @@ -7130,6 +7268,7 @@ static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const cha __Pyx_BufFmt_RaiseUnexpectedChar('Z'); return NULL; } + CYTHON_FALLTHROUGH; case 'c': case 'b': case 'B': case 'h': case 'H': case 'i': case 'I': case 'l': case 'L': case 'q': case 'Q': case 'f': case 'd': case 'g': @@ -7142,6 +7281,7 @@ static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const cha ++ts; break; } + CYTHON_FALLTHROUGH; case 's': if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; ctx->enc_count = ctx->new_count; @@ -7237,6 +7377,209 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg } #endif +/* PyCFunctionFastCall */ + #if CYTHON_FAST_PYCCALL +static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) { + PyCFunctionObject *func = (PyCFunctionObject*)func_obj; + PyCFunction meth = PyCFunction_GET_FUNCTION(func); + PyObject *self = PyCFunction_GET_SELF(func); + int flags = PyCFunction_GET_FLAGS(func); + assert(PyCFunction_Check(func)); + assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS))); + assert(nargs >= 0); + assert(nargs == 0 || args != NULL); + /* _PyCFunction_FastCallDict() must not be called with an exception set, + because it may clear it (directly or indirectly) and so the + caller loses its exception */ + assert(!PyErr_Occurred()); + if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) { + return (*((__Pyx_PyCFunctionFastWithKeywords)meth)) (self, args, nargs, NULL); + } else { + return (*((__Pyx_PyCFunctionFast)meth)) (self, args, nargs); + } +} +#endif + +/* PyFunctionFastCall */ + #if CYTHON_FAST_PYCALL +#include "frameobject.h" +static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, + PyObject *globals) { + PyFrameObject *f; + PyThreadState *tstate = __Pyx_PyThreadState_Current; + PyObject **fastlocals; + Py_ssize_t i; + PyObject *result; + assert(globals != NULL); + /* XXX Perhaps we should create a specialized + PyFrame_New() that doesn't take locals, but does + take builtins without sanity checking them. + */ + assert(tstate != NULL); + f = PyFrame_New(tstate, co, globals, NULL); + if (f == NULL) { + return NULL; + } + fastlocals = f->f_localsplus; + for (i = 0; i < na; i++) { + Py_INCREF(*args); + fastlocals[i] = *args++; + } + result = PyEval_EvalFrameEx(f,0); + ++tstate->recursion_depth; + Py_DECREF(f); + --tstate->recursion_depth; + return result; +} +#if 1 || PY_VERSION_HEX < 0x030600B1 +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs) { + PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); + PyObject *globals = PyFunction_GET_GLOBALS(func); + PyObject *argdefs = PyFunction_GET_DEFAULTS(func); + PyObject *closure; +#if PY_MAJOR_VERSION >= 3 + PyObject *kwdefs; +#endif + PyObject *kwtuple, **k; + PyObject **d; + Py_ssize_t nd; + Py_ssize_t nk; + PyObject *result; + assert(kwargs == NULL || PyDict_Check(kwargs)); + nk = kwargs ? PyDict_Size(kwargs) : 0; + if (Py_EnterRecursiveCall((char*)" while calling a Python object")) { + return NULL; + } + if ( +#if PY_MAJOR_VERSION >= 3 + co->co_kwonlyargcount == 0 && +#endif + likely(kwargs == NULL || nk == 0) && + co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { + if (argdefs == NULL && co->co_argcount == nargs) { + result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); + goto done; + } + else if (nargs == 0 && argdefs != NULL + && co->co_argcount == Py_SIZE(argdefs)) { + /* function called with no arguments, but all parameters have + a default value: use default values as arguments .*/ + args = &PyTuple_GET_ITEM(argdefs, 0); + result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); + goto done; + } + } + if (kwargs != NULL) { + Py_ssize_t pos, i; + kwtuple = PyTuple_New(2 * nk); + if (kwtuple == NULL) { + result = NULL; + goto done; + } + k = &PyTuple_GET_ITEM(kwtuple, 0); + pos = i = 0; + while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { + Py_INCREF(k[i]); + Py_INCREF(k[i+1]); + i += 2; + } + nk = i / 2; + } + else { + kwtuple = NULL; + k = NULL; + } + closure = PyFunction_GET_CLOSURE(func); +#if PY_MAJOR_VERSION >= 3 + kwdefs = PyFunction_GET_KW_DEFAULTS(func); +#endif + if (argdefs != NULL) { + d = &PyTuple_GET_ITEM(argdefs, 0); + nd = Py_SIZE(argdefs); + } + else { + d = NULL; + nd = 0; + } +#if PY_MAJOR_VERSION >= 3 + result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, + args, nargs, + k, (int)nk, + d, (int)nd, kwdefs, closure); +#else + result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, + args, nargs, + k, (int)nk, + d, (int)nd, closure); +#endif + Py_XDECREF(kwtuple); +done: + Py_LeaveRecursiveCall(); + return result; +} +#endif +#endif + +/* PyObjectCallMethO */ + #if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { + PyObject *self, *result; + PyCFunction cfunc; + cfunc = PyCFunction_GET_FUNCTION(func); + self = PyCFunction_GET_SELF(func); + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; + result = cfunc(self, arg); + Py_LeaveRecursiveCall(); + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +/* PyObjectCallOneArg */ + #if CYTHON_COMPILING_IN_CPYTHON +static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) { + PyObject *result; + PyObject *args = PyTuple_New(1); + if (unlikely(!args)) return NULL; + Py_INCREF(arg); + PyTuple_SET_ITEM(args, 0, arg); + result = __Pyx_PyObject_Call(func, args, NULL); + Py_DECREF(args); + return result; +} +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { +#if CYTHON_FAST_PYCALL + if (PyFunction_Check(func)) { + return __Pyx_PyFunction_FastCall(func, &arg, 1); + } +#endif + if (likely(PyCFunction_Check(func))) { + if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { + return __Pyx_PyObject_CallMethO(func, arg); +#if CYTHON_FAST_PYCCALL + } else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) { + return __Pyx_PyCFunction_FastCall(func, &arg, 1); +#endif + } + } + return __Pyx__PyObject_CallOneArg(func, arg); +} +#else +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { + PyObject *result; + PyObject *args = PyTuple_Pack(1, arg); + if (unlikely(!args)) return NULL; + result = __Pyx_PyObject_Call(func, args, NULL); + Py_DECREF(args); + return result; +} +#endif + /* PyErrFetchRestore */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { @@ -7420,6 +7763,25 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject } #endif +/* DictGetItem */ + #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY +static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) { + PyObject *value; + value = PyDict_GetItemWithError(d, key); + if (unlikely(!value)) { + if (!PyErr_Occurred()) { + PyObject* args = PyTuple_Pack(1, key); + if (likely(args)) + PyErr_SetObject(PyExc_KeyError, args); + Py_XDECREF(args); + } + return NULL; + } + Py_INCREF(value); + return value; +} +#endif + /* RaiseTooManyValuesToUnpack */ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { PyErr_Format(PyExc_ValueError, @@ -7662,7 +8024,7 @@ static int __Pyx_CLineForTraceback(CYTHON_UNUSED PyThreadState *tstate, int c_li #if CYTHON_COMPILING_IN_CPYTHON cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); if (likely(cython_runtime_dict)) { - use_cline = PyDict_GetItem(*cython_runtime_dict, __pyx_n_s_cline_in_traceback); + use_cline = __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback); } else #endif { @@ -7874,7 +8236,38 @@ static void __Pyx_ReleaseBuffer(Py_buffer *view) { #endif - /* CIntFromPyVerify */ + /* CIntToPy */ + static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_PY_LONG_LONG(unsigned PY_LONG_LONG value) { + const unsigned PY_LONG_LONG neg_one = (unsigned PY_LONG_LONG) -1, const_zero = (unsigned PY_LONG_LONG) 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(unsigned PY_LONG_LONG) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(unsigned PY_LONG_LONG) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(unsigned PY_LONG_LONG) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(unsigned PY_LONG_LONG) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(unsigned PY_LONG_LONG) <= 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; + return _PyLong_FromByteArray(bytes, sizeof(unsigned PY_LONG_LONG), + little, !is_unsigned); + } +} + +/* CIntFromPyVerify */ #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ @@ -9095,7 +9488,7 @@ static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class if (!*t->p) return -1; if (PyObject_Hash(*t->p) == -1) - PyErr_Clear(); + return -1; ++t; } return 0; diff --git a/pyndl/ndl_parallel.pyx b/pyndl/ndl_parallel.pyx index f88fbf3..0c591a0 100644 --- a/pyndl/ndl_parallel.pyx +++ b/pyndl/ndl_parallel.pyx @@ -10,9 +10,22 @@ cdef unsigned int MAGIC_NUMBER = 14159265 cdef unsigned int CURRENT_VERSION_WITH_FREQ = 215 cdef unsigned int CURRENT_VERSION = 2048 + 215 +# run two sanity checks while loading the extension +# 1. check if sizeof(unsigned int) != 4: raise ImportError('unsigned int needs to be 4 bytes not %i bytes' % sizeof(unsigned int)) +# 2. check +# integer overflow in uni-dimensional index +cdef unsigned long long test_index +cdef unsigned int test_cue_index, test_mm, test_outcome_index +test_cue_index = test_mm = test_outcome_index = 4294967295 + +test_index = test_mm +test_index *= test_outcome_index +test_index += test_cue_index +assert test_index == 18446744069414584320 + cdef inline void read_next_int(void *data, FILE *binary_file) nogil: fread(data, 4, 1, binary_file) # little endian @@ -115,7 +128,8 @@ cdef int learn_inplace_ptr(char* binary_file_path, dtype_t* weights, cdef unsigned int number_of_events, number_of_cues, number_of_outcomes cdef dtype_t association_strength, update - cdef unsigned int magic_number, version, ii, jj, event, index, appearance + cdef unsigned int magic_number, version, ii, jj, event, appearance + cdef unsigned long long index cdef unsigned int* cue_indices cdef unsigned int* outcome_indices cdef unsigned int max_number_of_cues = 1024 @@ -162,14 +176,21 @@ cdef int learn_inplace_ptr(char* binary_file_path, dtype_t* weights, for ii in range(start, end): association_strength = 0.0 for jj in range(number_of_cues): - index = cue_indices[jj] + mm * all_outcome_indices[ii] + # this overflows: + #index = cue_indices[jj] + mm * all_outcome_indices[ii] + index = mm # implicit cast to unsigned long long + index *= all_outcome_indices[ii] # this can't overflow anymore + index += cue_indices[jj] # this can't overflow anymore + # worst case: 4294967295 * 4294967295 + 4294967295 == 18446744069414584320 < 18446744073709551615 association_strength += weights[index] if is_element_of(all_outcome_indices[ii], outcome_indices, number_of_outcomes): update = beta1 * (lambda_ - association_strength) else: update = beta2 * (0.0 - association_strength) for jj in range(number_of_cues): - index = cue_indices[jj] + mm * all_outcome_indices[ii] + index = mm # implicit cast to unsigned long long + index *= all_outcome_indices[ii] # this can't overflow anymore + index += cue_indices[jj] # this can't overflow anymore weights[index] += alpha * update fclose(binary_file)