diff --git a/armer/armer.py b/armer/armer.py index 6c6a544..b46d9e3 100644 --- a/armer/armer.py +++ b/armer/armer.py @@ -306,7 +306,7 @@ def global_collision_check(self, robot: ROSRobot): debug=True ) end = timeit.default_timer() - print(f"[KD Setup] full collision check: {1/(end-start)} hz") + # print(f"[KD Setup] full collision check: {1/(end-start)} hz") # print(f"[Check Links] -> {check_links}") # Alternative Method @@ -323,7 +323,7 @@ def global_collision_check(self, robot: ROSRobot): check_links = check_links ) end = timeit.default_timer() - print(f"[Actual Link Check] full collision check: {1/(end-start)} hz") + # print(f"[Actual Link Check] full collision check: {1/(end-start)} hz") if col_link_id >= 0: rospy.logwarn(f"Global Collision Check -> Robot [{robot.name}] in collision with link {robot.collision_sliced_links[col_link_id].name}") @@ -435,7 +435,7 @@ def update_dynamic_objects(self, robot: ROSRobot) -> None: else: # Check if the current robot has any newly added objects to add to the backend # NOTE: this loop is run everytime at the moment (not an issue with limited shapes but needs better optimisation for scale) - for dynamic_obj in robot.dynamic_collision_dict.values(): + for dynamic_obj in robot.dynamic_collision_dict.copy().values(): if dynamic_obj.is_added == False: rospy.loginfo(f"Adding Dynamic Object: {dynamic_obj}") dynamic_obj.id = self.backend.add(dynamic_obj.shape) diff --git a/armer/cython/collision_handler.cpp b/armer/cython/collision_handler.cpp index 63934be..0966e50 100644 --- a/armer/cython/collision_handler.cpp +++ b/armer/cython/collision_handler.cpp @@ -1218,15 +1218,6 @@ static CYTHON_INLINE float __PYX_NAN() { #include #include #include -#include - - /* Using NumPy API declarations from "numpy/__init__.cython-30.pxd" */ - -#include "numpy/arrayobject.h" -#include "numpy/ndarrayobject.h" -#include "numpy/ndarraytypes.h" -#include "numpy/arrayscalars.h" -#include "numpy/ufuncobject.h" #include #ifdef _OPENMP #include @@ -1490,34 +1481,10 @@ static int __pyx_clineno = 0; static const char * __pyx_cfilenm = __FILE__; static const char *__pyx_filename; -/* Header.proto */ -#if !defined(CYTHON_CCOMPLEX) - #if defined(__cplusplus) - #define CYTHON_CCOMPLEX 1 - #elif (defined(_Complex_I) && !defined(_MSC_VER)) || ((defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) && !defined(__STDC_NO_COMPLEX__)) - #define CYTHON_CCOMPLEX 1 - #else - #define CYTHON_CCOMPLEX 0 - #endif -#endif -#if CYTHON_CCOMPLEX - #ifdef __cplusplus - #include - #else - #include - #endif -#endif -#if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__) - #undef _Complex_I - #define _Complex_I 1.0fj -#endif - /* #### Code section: filename_table ### */ static const char *__pyx_f[] = { "armer/cython/collision_handler.pyx", - "__init__.cython-30.pxd", - "type.pxd", }; /* #### Code section: utility_code_proto_before_types ### */ /* ForceInitThreads.proto */ @@ -1526,268 +1493,10 @@ static const char *__pyx_f[] = { #endif /* #### Code section: numeric_typedefs ### */ - -/* "../../../../../../usr/local/lib/python3.8/dist-packages/numpy/__init__.cython-30.pxd":731 - * # in Cython to enable them only on the right systems. - * - * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<< - * ctypedef npy_int16 int16_t - * ctypedef npy_int32 int32_t - */ -typedef npy_int8 __pyx_t_5numpy_int8_t; - -/* "../../../../../../usr/local/lib/python3.8/dist-packages/numpy/__init__.cython-30.pxd":732 - * - * ctypedef npy_int8 int8_t - * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<< - * ctypedef npy_int32 int32_t - * ctypedef npy_int64 int64_t - */ -typedef npy_int16 __pyx_t_5numpy_int16_t; - -/* "../../../../../../usr/local/lib/python3.8/dist-packages/numpy/__init__.cython-30.pxd":733 - * ctypedef npy_int8 int8_t - * ctypedef npy_int16 int16_t - * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<< - * ctypedef npy_int64 int64_t - * #ctypedef npy_int96 int96_t - */ -typedef npy_int32 __pyx_t_5numpy_int32_t; - -/* "../../../../../../usr/local/lib/python3.8/dist-packages/numpy/__init__.cython-30.pxd":734 - * ctypedef npy_int16 int16_t - * ctypedef npy_int32 int32_t - * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<< - * #ctypedef npy_int96 int96_t - * #ctypedef npy_int128 int128_t - */ -typedef npy_int64 __pyx_t_5numpy_int64_t; - -/* "../../../../../../usr/local/lib/python3.8/dist-packages/numpy/__init__.cython-30.pxd":738 - * #ctypedef npy_int128 int128_t - * - * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<< - * ctypedef npy_uint16 uint16_t - * ctypedef npy_uint32 uint32_t - */ -typedef npy_uint8 __pyx_t_5numpy_uint8_t; - -/* "../../../../../../usr/local/lib/python3.8/dist-packages/numpy/__init__.cython-30.pxd":739 - * - * ctypedef npy_uint8 uint8_t - * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<< - * ctypedef npy_uint32 uint32_t - * ctypedef npy_uint64 uint64_t - */ -typedef npy_uint16 __pyx_t_5numpy_uint16_t; - -/* "../../../../../../usr/local/lib/python3.8/dist-packages/numpy/__init__.cython-30.pxd":740 - * ctypedef npy_uint8 uint8_t - * ctypedef npy_uint16 uint16_t - * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<< - * ctypedef npy_uint64 uint64_t - * #ctypedef npy_uint96 uint96_t - */ -typedef npy_uint32 __pyx_t_5numpy_uint32_t; - -/* "../../../../../../usr/local/lib/python3.8/dist-packages/numpy/__init__.cython-30.pxd":741 - * ctypedef npy_uint16 uint16_t - * ctypedef npy_uint32 uint32_t - * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<< - * #ctypedef npy_uint96 uint96_t - * #ctypedef npy_uint128 uint128_t - */ -typedef npy_uint64 __pyx_t_5numpy_uint64_t; - -/* "../../../../../../usr/local/lib/python3.8/dist-packages/numpy/__init__.cython-30.pxd":745 - * #ctypedef npy_uint128 uint128_t - * - * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<< - * ctypedef npy_float64 float64_t - * #ctypedef npy_float80 float80_t - */ -typedef npy_float32 __pyx_t_5numpy_float32_t; - -/* "../../../../../../usr/local/lib/python3.8/dist-packages/numpy/__init__.cython-30.pxd":746 - * - * ctypedef npy_float32 float32_t - * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<< - * #ctypedef npy_float80 float80_t - * #ctypedef npy_float128 float128_t - */ -typedef npy_float64 __pyx_t_5numpy_float64_t; - -/* "../../../../../../usr/local/lib/python3.8/dist-packages/numpy/__init__.cython-30.pxd":755 - * # The int types are mapped a bit surprising -- - * # numpy.int corresponds to 'l' and numpy.long to 'q' - * ctypedef npy_long int_t # <<<<<<<<<<<<<< - * ctypedef npy_longlong long_t - * ctypedef npy_longlong longlong_t - */ -typedef npy_long __pyx_t_5numpy_int_t; - -/* "../../../../../../usr/local/lib/python3.8/dist-packages/numpy/__init__.cython-30.pxd":756 - * # numpy.int corresponds to 'l' and numpy.long to 'q' - * ctypedef npy_long int_t - * ctypedef npy_longlong long_t # <<<<<<<<<<<<<< - * ctypedef npy_longlong longlong_t - * - */ -typedef npy_longlong __pyx_t_5numpy_long_t; - -/* "../../../../../../usr/local/lib/python3.8/dist-packages/numpy/__init__.cython-30.pxd":757 - * ctypedef npy_long int_t - * ctypedef npy_longlong long_t - * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<< - * - * ctypedef npy_ulong uint_t - */ -typedef npy_longlong __pyx_t_5numpy_longlong_t; - -/* "../../../../../../usr/local/lib/python3.8/dist-packages/numpy/__init__.cython-30.pxd":759 - * ctypedef npy_longlong longlong_t - * - * ctypedef npy_ulong uint_t # <<<<<<<<<<<<<< - * ctypedef npy_ulonglong ulong_t - * ctypedef npy_ulonglong ulonglong_t - */ -typedef npy_ulong __pyx_t_5numpy_uint_t; - -/* "../../../../../../usr/local/lib/python3.8/dist-packages/numpy/__init__.cython-30.pxd":760 - * - * ctypedef npy_ulong uint_t - * ctypedef npy_ulonglong ulong_t # <<<<<<<<<<<<<< - * ctypedef npy_ulonglong ulonglong_t - * - */ -typedef npy_ulonglong __pyx_t_5numpy_ulong_t; - -/* "../../../../../../usr/local/lib/python3.8/dist-packages/numpy/__init__.cython-30.pxd":761 - * ctypedef npy_ulong uint_t - * ctypedef npy_ulonglong ulong_t - * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<< - * - * ctypedef npy_intp intp_t - */ -typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t; - -/* "../../../../../../usr/local/lib/python3.8/dist-packages/numpy/__init__.cython-30.pxd":763 - * ctypedef npy_ulonglong ulonglong_t - * - * ctypedef npy_intp intp_t # <<<<<<<<<<<<<< - * ctypedef npy_uintp uintp_t - * - */ -typedef npy_intp __pyx_t_5numpy_intp_t; - -/* "../../../../../../usr/local/lib/python3.8/dist-packages/numpy/__init__.cython-30.pxd":764 - * - * ctypedef npy_intp intp_t - * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<< - * - * ctypedef npy_double float_t - */ -typedef npy_uintp __pyx_t_5numpy_uintp_t; - -/* "../../../../../../usr/local/lib/python3.8/dist-packages/numpy/__init__.cython-30.pxd":766 - * ctypedef npy_uintp uintp_t - * - * ctypedef npy_double float_t # <<<<<<<<<<<<<< - * ctypedef npy_double double_t - * ctypedef npy_longdouble longdouble_t - */ -typedef npy_double __pyx_t_5numpy_float_t; - -/* "../../../../../../usr/local/lib/python3.8/dist-packages/numpy/__init__.cython-30.pxd":767 - * - * ctypedef npy_double float_t - * ctypedef npy_double double_t # <<<<<<<<<<<<<< - * ctypedef npy_longdouble longdouble_t - * - */ -typedef npy_double __pyx_t_5numpy_double_t; - -/* "../../../../../../usr/local/lib/python3.8/dist-packages/numpy/__init__.cython-30.pxd":768 - * ctypedef npy_double float_t - * ctypedef npy_double double_t - * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<< - * - * ctypedef npy_cfloat cfloat_t - */ -typedef npy_longdouble __pyx_t_5numpy_longdouble_t; - -/* "collision_handler.pyx":10 - * cnp.import_array() - * DTYPE = np.float64 - * ctypedef cnp.float64_t DTYPE_t # <<<<<<<<<<<<<< - * - * cdef extern from "" namespace "std": - */ -typedef __pyx_t_5numpy_float64_t __pyx_t_17collision_handler_DTYPE_t; /* #### Code section: complex_type_declarations ### */ -/* Declarations.proto */ -#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus) - #ifdef __cplusplus - typedef ::std::complex< float > __pyx_t_float_complex; - #else - typedef float _Complex __pyx_t_float_complex; - #endif -#else - typedef struct { float real, imag; } __pyx_t_float_complex; -#endif -static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float); - -/* Declarations.proto */ -#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus) - #ifdef __cplusplus - typedef ::std::complex< double > __pyx_t_double_complex; - #else - typedef double _Complex __pyx_t_double_complex; - #endif -#else - typedef struct { double real, imag; } __pyx_t_double_complex; -#endif -static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double); - /* #### Code section: type_declarations ### */ /*--- Type declarations ---*/ - -/* "../../../../../../usr/local/lib/python3.8/dist-packages/numpy/__init__.cython-30.pxd":770 - * ctypedef npy_longdouble longdouble_t - * - * ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<< - * ctypedef npy_cdouble cdouble_t - * ctypedef npy_clongdouble clongdouble_t - */ -typedef npy_cfloat __pyx_t_5numpy_cfloat_t; - -/* "../../../../../../usr/local/lib/python3.8/dist-packages/numpy/__init__.cython-30.pxd":771 - * - * ctypedef npy_cfloat cfloat_t - * ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<< - * ctypedef npy_clongdouble clongdouble_t - * - */ -typedef npy_cdouble __pyx_t_5numpy_cdouble_t; - -/* "../../../../../../usr/local/lib/python3.8/dist-packages/numpy/__init__.cython-30.pxd":772 - * ctypedef npy_cfloat cfloat_t - * ctypedef npy_cdouble cdouble_t - * ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<< - * - * ctypedef npy_cdouble complex_t - */ -typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t; - -/* "../../../../../../usr/local/lib/python3.8/dist-packages/numpy/__init__.cython-30.pxd":774 - * ctypedef npy_clongdouble clongdouble_t - * - * ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<< - * - * cdef inline object PyArray_MultiIterNew1(a): - */ -typedef npy_cdouble __pyx_t_5numpy_complex_t; /* #### Code section: utility_code_proto ### */ /* --- Runtime support code (head) --- */ @@ -1934,40 +1643,6 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, P /* GetBuiltinName.proto */ static PyObject *__Pyx_GetBuiltinName(PyObject *name); -/* GetTopmostException.proto */ -#if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE -static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate); -#endif - -/* SaveResetException.proto */ -#if CYTHON_FAST_THREAD_STATE -#define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb) -static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); -#define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb) -static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); -#else -#define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb) -#define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb) -#endif - -/* GetException.proto */ -#if CYTHON_FAST_THREAD_STATE -#define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb) -static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); -#else -static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); -#endif - -/* PyObjectCall.proto */ -#if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); -#else -#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) -#endif - -/* RaiseException.proto */ -static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); - /* GetItemInt.proto */ #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ @@ -2004,12 +1679,6 @@ static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key); #define __Pyx_PyObject_Dict_GetItem(obj, name) PyObject_GetItem(obj, name) #endif -/* PySequenceContains.proto */ -static CYTHON_INLINE int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq, int eq) { - int result = PySequence_Contains(seq, item); - return unlikely(result < 0) ? result : (result == (eq == Py_EQ)); -} - /* PyFunctionFastCall.proto */ #if CYTHON_FAST_PYCALL #if !CYTHON_VECTORCALL @@ -2045,6 +1714,13 @@ static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, #endif #endif +/* PyObjectCall.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); +#else +#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) +#endif + /* PyObjectCallMethO.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); @@ -2066,9 +1742,6 @@ static CYTHON_INLINE int __Pyx_IterFinish(void); /* UnpackItemEndCheck.proto */ static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); -/* ExtTypeTest.proto */ -static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); - /* TupleAndListFromArray.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n); @@ -2164,80 +1837,11 @@ static CYTHON_INLINE int __Pyx_PyDict_ContainsTF(PyObject* item, PyObject* dict, return unlikely(result < 0) ? result : (result == (eq == Py_EQ)); } -/* TypeImport.proto */ -#ifndef __PYX_HAVE_RT_ImportType_proto_3_0_5 -#define __PYX_HAVE_RT_ImportType_proto_3_0_5 -#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L -#include -#endif -#if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) || __cplusplus >= 201103L -#define __PYX_GET_STRUCT_ALIGNMENT_3_0_5(s) alignof(s) -#else -#define __PYX_GET_STRUCT_ALIGNMENT_3_0_5(s) sizeof(void*) -#endif -enum __Pyx_ImportType_CheckSize_3_0_5 { - __Pyx_ImportType_CheckSize_Error_3_0_5 = 0, - __Pyx_ImportType_CheckSize_Warn_3_0_5 = 1, - __Pyx_ImportType_CheckSize_Ignore_3_0_5 = 2 -}; -static PyTypeObject *__Pyx_ImportType_3_0_5(PyObject* module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_5 check_size); -#endif - -/* Import.proto */ -static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); - -/* ImportDottedModule.proto */ -static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple); -#if PY_MAJOR_VERSION >= 3 -static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple); -#endif - -/* PyDictVersioning.proto */ -#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS -#define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1) -#define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) -#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ - (version_var) = __PYX_GET_DICT_VERSION(dict);\ - (cache_var) = (value); -#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ - static PY_UINT64_T __pyx_dict_version = 0;\ - static PyObject *__pyx_dict_cached_value = NULL;\ - if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ - (VAR) = __pyx_dict_cached_value;\ - } else {\ - (VAR) = __pyx_dict_cached_value = (LOOKUP);\ - __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ - }\ +/* PySequenceContains.proto */ +static CYTHON_INLINE int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq, int eq) { + int result = PySequence_Contains(seq, item); + return unlikely(result < 0) ? result : (result == (eq == Py_EQ)); } -static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj); -static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj); -static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version); -#else -#define __PYX_GET_DICT_VERSION(dict) (0) -#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) -#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); -#endif - -/* GetModuleGlobalName.proto */ -#if CYTHON_USE_DICT_VERSIONS -#define __Pyx_GetModuleGlobalName(var, name) do {\ - static PY_UINT64_T __pyx_dict_version = 0;\ - static PyObject *__pyx_dict_cached_value = NULL;\ - (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ - (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ - __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ -} while(0) -#define __Pyx_GetModuleGlobalNameUncached(var, name) do {\ - PY_UINT64_T __pyx_dict_version;\ - PyObject *__pyx_dict_cached_value;\ - (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ -} while(0) -static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value); -#else -#define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name) -#define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name) -static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name); -#endif /* IncludeStructmemberH.proto */ #include @@ -2387,6 +1991,32 @@ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, PyObject *module, PyObject *globals, PyObject* code); +/* PyDictVersioning.proto */ +#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS +#define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1) +#define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) +#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ + (version_var) = __PYX_GET_DICT_VERSION(dict);\ + (cache_var) = (value); +#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ + static PY_UINT64_T __pyx_dict_version = 0;\ + static PyObject *__pyx_dict_cached_value = NULL;\ + if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ + (VAR) = __pyx_dict_cached_value;\ + } else {\ + (VAR) = __pyx_dict_cached_value = (LOOKUP);\ + __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ + }\ +} +static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj); +static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj); +static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version); +#else +#define __PYX_GET_DICT_VERSION(dict) (0) +#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) +#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); +#endif + /* CLineInTraceback.proto */ #ifdef CYTHON_CLINE_IN_TRACEBACK #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) @@ -2420,113 +2050,12 @@ static void __Pyx_AddTraceback(const char *funcname, int c_line, #define __Pyx_HAS_GCC_DIAGNOSTIC #endif -/* RealImag.proto */ -#if CYTHON_CCOMPLEX - #ifdef __cplusplus - #define __Pyx_CREAL(z) ((z).real()) - #define __Pyx_CIMAG(z) ((z).imag()) - #else - #define __Pyx_CREAL(z) (__real__(z)) - #define __Pyx_CIMAG(z) (__imag__(z)) - #endif -#else - #define __Pyx_CREAL(z) ((z).real) - #define __Pyx_CIMAG(z) ((z).imag) -#endif -#if defined(__cplusplus) && CYTHON_CCOMPLEX\ - && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103) - #define __Pyx_SET_CREAL(z,x) ((z).real(x)) - #define __Pyx_SET_CIMAG(z,y) ((z).imag(y)) -#else - #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x) - #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y) -#endif - -/* Arithmetic.proto */ -#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus) - #define __Pyx_c_eq_float(a, b) ((a)==(b)) - #define __Pyx_c_sum_float(a, b) ((a)+(b)) - #define __Pyx_c_diff_float(a, b) ((a)-(b)) - #define __Pyx_c_prod_float(a, b) ((a)*(b)) - #define __Pyx_c_quot_float(a, b) ((a)/(b)) - #define __Pyx_c_neg_float(a) (-(a)) - #ifdef __cplusplus - #define __Pyx_c_is_zero_float(z) ((z)==(float)0) - #define __Pyx_c_conj_float(z) (::std::conj(z)) - #if 1 - #define __Pyx_c_abs_float(z) (::std::abs(z)) - #define __Pyx_c_pow_float(a, b) (::std::pow(a, b)) - #endif - #else - #define __Pyx_c_is_zero_float(z) ((z)==0) - #define __Pyx_c_conj_float(z) (conjf(z)) - #if 1 - #define __Pyx_c_abs_float(z) (cabsf(z)) - #define __Pyx_c_pow_float(a, b) (cpowf(a, b)) - #endif - #endif -#else - static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex, __pyx_t_float_complex); - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex, __pyx_t_float_complex); - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex, __pyx_t_float_complex); - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex, __pyx_t_float_complex); - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex, __pyx_t_float_complex); - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex); - static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex); - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex); - #if 1 - static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex); - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex, __pyx_t_float_complex); - #endif -#endif - -/* Arithmetic.proto */ -#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus) - #define __Pyx_c_eq_double(a, b) ((a)==(b)) - #define __Pyx_c_sum_double(a, b) ((a)+(b)) - #define __Pyx_c_diff_double(a, b) ((a)-(b)) - #define __Pyx_c_prod_double(a, b) ((a)*(b)) - #define __Pyx_c_quot_double(a, b) ((a)/(b)) - #define __Pyx_c_neg_double(a) (-(a)) - #ifdef __cplusplus - #define __Pyx_c_is_zero_double(z) ((z)==(double)0) - #define __Pyx_c_conj_double(z) (::std::conj(z)) - #if 1 - #define __Pyx_c_abs_double(z) (::std::abs(z)) - #define __Pyx_c_pow_double(a, b) (::std::pow(a, b)) - #endif - #else - #define __Pyx_c_is_zero_double(z) ((z)==0) - #define __Pyx_c_conj_double(z) (conj(z)) - #if 1 - #define __Pyx_c_abs_double(z) (cabs(z)) - #define __Pyx_c_pow_double(a, b) (cpow(a, b)) - #endif - #endif -#else - static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex, __pyx_t_double_complex); - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex, __pyx_t_double_complex); - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex, __pyx_t_double_complex); - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex, __pyx_t_double_complex); - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex, __pyx_t_double_complex); - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex); - static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex); - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex); - #if 1 - static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex); - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex, __pyx_t_double_complex); - #endif -#endif - /* CIntFromPy.proto */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); -/* CIntToPy.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); - /* FormatTypeName.proto */ #if CYTHON_COMPILING_IN_LIMITED_API typedef PyObject *__Pyx_TypeName; @@ -2540,6 +2069,9 @@ typedef const char *__Pyx_TypeName; #define __Pyx_DECREF_TypeName(obj) #endif +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); + /* CIntFromPy.proto */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); @@ -2568,13 +2100,6 @@ static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /* #### Code section: module_declarations ### */ -static CYTHON_INLINE PyObject *__pyx_f_5numpy_7ndarray_4base_base(PyArrayObject *__pyx_v_self); /* proto*/ -static CYTHON_INLINE PyArray_Descr *__pyx_f_5numpy_7ndarray_5descr_descr(PyArrayObject *__pyx_v_self); /* proto*/ -static CYTHON_INLINE int __pyx_f_5numpy_7ndarray_4ndim_ndim(PyArrayObject *__pyx_v_self); /* proto*/ -static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_5shape_shape(PyArrayObject *__pyx_v_self); /* proto*/ -static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_7strides_strides(PyArrayObject *__pyx_v_self); /* proto*/ -static CYTHON_INLINE npy_intp __pyx_f_5numpy_7ndarray_4size_size(PyArrayObject *__pyx_v_self); /* proto*/ -static CYTHON_INLINE char *__pyx_f_5numpy_7ndarray_4data_data(PyArrayObject *__pyx_v_self); /* proto*/ /* Module declarations from "libc.math" */ @@ -2586,25 +2111,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy_7ndarray_4data_data(PyArrayObject *__p /* Module declarations from "cython" */ -/* Module declarations from "libc.stdio" */ - -/* Module declarations from "__builtin__" */ - -/* Module declarations from "cpython.type" */ - -/* Module declarations from "cpython" */ - -/* Module declarations from "cpython.object" */ - -/* Module declarations from "cpython.ref" */ - -/* Module declarations from "numpy" */ - -/* Module declarations from "numpy" */ -static CYTHON_INLINE int __pyx_f_5numpy_import_array(void); /*proto*/ - /* Module declarations from "collision_handler" */ -static PyObject *__pyx_f_17collision_handler_closest_dist_query(PyObject *, PyObject *, int, PyObject *, PyObject *, int __pyx_skip_dispatch); /*proto*/ static int __pyx_f_17collision_handler_col_check(PyObject *, PyObject *, int, PyObject *, int __pyx_skip_dispatch); /*proto*/ static int __pyx_f_17collision_handler_global_check(PyObject *, PyObject *, int, PyObject *, int, PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch); /*proto*/ static int __pyx_f_17collision_handler_test(int, int, int __pyx_skip_dispatch); /*proto*/ @@ -2617,57 +2124,39 @@ int __pyx_module_is_main_collision_handler = 0; /* Implementation of "collision_handler" */ /* #### Code section: global_var ### */ static PyObject *__pyx_builtin_range; -static PyObject *__pyx_builtin_ImportError; /* #### Code section: string_decls ### */ -static const char __pyx_k__3[] = "*"; -static const char __pyx_k_np[] = "np"; -static const char __pyx_k__12[] = "?"; +static const char __pyx_k__7[] = "?"; static const char __pyx_k_copy[] = "copy"; static const char __pyx_k_main[] = "__main__"; static const char __pyx_k_name[] = "name"; -static const char __pyx_k_spec[] = "__spec__"; static const char __pyx_k_test[] = "test"; static const char __pyx_k_val1[] = "val1"; static const char __pyx_k_val2[] = "val2"; -static const char __pyx_k_DTYPE[] = "DTYPE"; -static const char __pyx_k_numpy[] = "numpy"; static const char __pyx_k_range[] = "range"; -static const char __pyx_k_import[] = "__import__"; static const char __pyx_k_name_2[] = "__name__"; static const char __pyx_k_test_2[] = "__test__"; -static const char __pyx_k_float64[] = "float64"; -static const char __pyx_k_col_dict[] = "col_dict"; static const char __pyx_k_col_check[] = "col_check"; static const char __pyx_k_collision[] = "collision"; static const char __pyx_k_len_links[] = "len_links"; static const char __pyx_k_len_robots[] = "len_robots"; static const char __pyx_k_robot_name[] = "robot_name"; -static const char __pyx_k_ImportError[] = "ImportError"; static const char __pyx_k_check_links[] = "check_links"; static const char __pyx_k_global_dict[] = "global_dict"; static const char __pyx_k_robot_links[] = "robot_links"; static const char __pyx_k_robot_names[] = "robot_names"; static const char __pyx_k_global_check[] = "global_check"; -static const char __pyx_k_initializing[] = "_initializing"; static const char __pyx_k_is_coroutine[] = "_is_coroutine"; static const char __pyx_k_overlap_dict[] = "overlap_dict"; static const char __pyx_k_sliced_links[] = "sliced_links"; static const char __pyx_k_closest_point[] = "closest_point"; -static const char __pyx_k_col_link_names[] = "col_link_names"; -static const char __pyx_k_sliced_link_name[] = "sliced_link_name"; -static const char __pyx_k_col_link_name_len[] = "col_link_name_len"; static const char __pyx_k_collision_handler[] = "collision_handler"; static const char __pyx_k_asyncio_coroutines[] = "asyncio.coroutines"; static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; -static const char __pyx_k_closest_dist_query[] = "closest_dist_query"; -static const char __pyx_k_numpy_core_multiarray_failed_to[] = "numpy.core.multiarray failed to import"; static const char __pyx_k_armer_cython_collision_handler_p[] = "armer/cython/collision_handler.pyx"; -static const char __pyx_k_numpy_core_umath_failed_to_impor[] = "numpy.core.umath failed to import"; /* #### Code section: decls ### */ -static PyObject *__pyx_pf_17collision_handler_closest_dist_query(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_sliced_link_name, PyObject *__pyx_v_col_link_names, int __pyx_v_col_link_name_len, PyObject *__pyx_v_col_dict, PyObject *__pyx_v_overlap_dict); /* proto */ -static PyObject *__pyx_pf_17collision_handler_2col_check(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_sliced_links, PyObject *__pyx_v_check_links, int __pyx_v_len_links, PyObject *__pyx_v_global_dict); /* proto */ -static PyObject *__pyx_pf_17collision_handler_4global_check(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_robot_name, PyObject *__pyx_v_robot_names, int __pyx_v_len_robots, PyObject *__pyx_v_robot_links, int __pyx_v_len_links, PyObject *__pyx_v_global_dict, PyObject *__pyx_v_overlap_dict, PyObject *__pyx_v_check_links); /* proto */ -static PyObject *__pyx_pf_17collision_handler_6test(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_val1, int __pyx_v_val2); /* proto */ +static PyObject *__pyx_pf_17collision_handler_col_check(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_sliced_links, PyObject *__pyx_v_check_links, int __pyx_v_len_links, PyObject *__pyx_v_global_dict); /* proto */ +static PyObject *__pyx_pf_17collision_handler_2global_check(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_robot_name, PyObject *__pyx_v_robot_names, int __pyx_v_len_robots, PyObject *__pyx_v_robot_links, int __pyx_v_len_links, PyObject *__pyx_v_global_dict, PyObject *__pyx_v_overlap_dict, PyObject *__pyx_v_check_links); /* proto */ +static PyObject *__pyx_pf_17collision_handler_4test(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_val1, int __pyx_v_val2); /* proto */ /* #### Code section: late_includes ### */ /* #### Code section: module_state ### */ typedef struct { @@ -2707,93 +2196,41 @@ typedef struct { #endif #if CYTHON_USE_MODULE_STATE #endif - #if CYTHON_USE_MODULE_STATE - #endif - #if CYTHON_USE_MODULE_STATE - #endif - PyTypeObject *__pyx_ptype_7cpython_4type_type; - #if CYTHON_USE_MODULE_STATE - #endif - #if CYTHON_USE_MODULE_STATE - #endif - #if CYTHON_USE_MODULE_STATE - #endif - #if CYTHON_USE_MODULE_STATE - #endif - #if CYTHON_USE_MODULE_STATE - #endif - PyTypeObject *__pyx_ptype_5numpy_dtype; - PyTypeObject *__pyx_ptype_5numpy_flatiter; - PyTypeObject *__pyx_ptype_5numpy_broadcast; - PyTypeObject *__pyx_ptype_5numpy_ndarray; - PyTypeObject *__pyx_ptype_5numpy_generic; - PyTypeObject *__pyx_ptype_5numpy_number; - PyTypeObject *__pyx_ptype_5numpy_integer; - PyTypeObject *__pyx_ptype_5numpy_signedinteger; - PyTypeObject *__pyx_ptype_5numpy_unsignedinteger; - PyTypeObject *__pyx_ptype_5numpy_inexact; - PyTypeObject *__pyx_ptype_5numpy_floating; - PyTypeObject *__pyx_ptype_5numpy_complexfloating; - PyTypeObject *__pyx_ptype_5numpy_flexible; - PyTypeObject *__pyx_ptype_5numpy_character; - PyTypeObject *__pyx_ptype_5numpy_ufunc; - #if CYTHON_USE_MODULE_STATE - #endif - PyObject *__pyx_n_s_DTYPE; - PyObject *__pyx_n_s_ImportError; - PyObject *__pyx_n_s__12; - PyObject *__pyx_n_s__3; + PyObject *__pyx_n_s__7; PyObject *__pyx_kp_s_armer_cython_collision_handler_p; PyObject *__pyx_n_s_asyncio_coroutines; PyObject *__pyx_n_s_check_links; PyObject *__pyx_n_s_cline_in_traceback; - PyObject *__pyx_n_s_closest_dist_query; PyObject *__pyx_n_s_closest_point; PyObject *__pyx_n_s_col_check; - PyObject *__pyx_n_s_col_dict; - PyObject *__pyx_n_s_col_link_name_len; - PyObject *__pyx_n_s_col_link_names; PyObject *__pyx_n_s_collision; PyObject *__pyx_n_s_collision_handler; PyObject *__pyx_n_s_copy; - PyObject *__pyx_n_s_float64; PyObject *__pyx_n_s_global_check; PyObject *__pyx_n_s_global_dict; - PyObject *__pyx_n_s_import; - PyObject *__pyx_n_s_initializing; PyObject *__pyx_n_s_is_coroutine; PyObject *__pyx_n_s_len_links; PyObject *__pyx_n_s_len_robots; PyObject *__pyx_n_s_main; PyObject *__pyx_n_s_name; PyObject *__pyx_n_s_name_2; - PyObject *__pyx_n_s_np; - PyObject *__pyx_n_s_numpy; - PyObject *__pyx_kp_s_numpy_core_multiarray_failed_to; - PyObject *__pyx_kp_s_numpy_core_umath_failed_to_impor; PyObject *__pyx_n_s_overlap_dict; PyObject *__pyx_n_s_range; PyObject *__pyx_n_s_robot_links; PyObject *__pyx_n_s_robot_name; PyObject *__pyx_n_s_robot_names; - PyObject *__pyx_n_s_sliced_link_name; PyObject *__pyx_n_s_sliced_links; - PyObject *__pyx_n_s_spec; PyObject *__pyx_n_s_test; PyObject *__pyx_n_s_test_2; PyObject *__pyx_n_s_val1; PyObject *__pyx_n_s_val2; PyObject *__pyx_int_0; PyObject *__pyx_tuple_; - PyObject *__pyx_tuple__2; - PyObject *__pyx_tuple__4; - PyObject *__pyx_tuple__6; - PyObject *__pyx_tuple__8; - PyObject *__pyx_tuple__10; - PyObject *__pyx_codeobj__5; - PyObject *__pyx_codeobj__7; - PyObject *__pyx_codeobj__9; - PyObject *__pyx_codeobj__11; + PyObject *__pyx_tuple__3; + PyObject *__pyx_tuple__5; + PyObject *__pyx_codeobj__2; + PyObject *__pyx_codeobj__4; + PyObject *__pyx_codeobj__6; } __pyx_mstate; #if CYTHON_USE_MODULE_STATE @@ -2836,77 +2273,41 @@ static int __pyx_m_clear(PyObject *m) { #ifdef __Pyx_FusedFunction_USED Py_CLEAR(clear_module_state->__pyx_FusedFunctionType); #endif - Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_4type_type); - Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_dtype); - Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_flatiter); - Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_broadcast); - Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_ndarray); - Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_generic); - Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_number); - Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_integer); - Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_signedinteger); - Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_unsignedinteger); - Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_inexact); - Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_floating); - Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_complexfloating); - Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_flexible); - Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_character); - Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_ufunc); - Py_CLEAR(clear_module_state->__pyx_n_s_DTYPE); - Py_CLEAR(clear_module_state->__pyx_n_s_ImportError); - Py_CLEAR(clear_module_state->__pyx_n_s__12); - Py_CLEAR(clear_module_state->__pyx_n_s__3); + Py_CLEAR(clear_module_state->__pyx_n_s__7); Py_CLEAR(clear_module_state->__pyx_kp_s_armer_cython_collision_handler_p); Py_CLEAR(clear_module_state->__pyx_n_s_asyncio_coroutines); Py_CLEAR(clear_module_state->__pyx_n_s_check_links); Py_CLEAR(clear_module_state->__pyx_n_s_cline_in_traceback); - Py_CLEAR(clear_module_state->__pyx_n_s_closest_dist_query); Py_CLEAR(clear_module_state->__pyx_n_s_closest_point); Py_CLEAR(clear_module_state->__pyx_n_s_col_check); - Py_CLEAR(clear_module_state->__pyx_n_s_col_dict); - Py_CLEAR(clear_module_state->__pyx_n_s_col_link_name_len); - Py_CLEAR(clear_module_state->__pyx_n_s_col_link_names); Py_CLEAR(clear_module_state->__pyx_n_s_collision); Py_CLEAR(clear_module_state->__pyx_n_s_collision_handler); Py_CLEAR(clear_module_state->__pyx_n_s_copy); - Py_CLEAR(clear_module_state->__pyx_n_s_float64); Py_CLEAR(clear_module_state->__pyx_n_s_global_check); Py_CLEAR(clear_module_state->__pyx_n_s_global_dict); - Py_CLEAR(clear_module_state->__pyx_n_s_import); - Py_CLEAR(clear_module_state->__pyx_n_s_initializing); Py_CLEAR(clear_module_state->__pyx_n_s_is_coroutine); Py_CLEAR(clear_module_state->__pyx_n_s_len_links); Py_CLEAR(clear_module_state->__pyx_n_s_len_robots); Py_CLEAR(clear_module_state->__pyx_n_s_main); Py_CLEAR(clear_module_state->__pyx_n_s_name); Py_CLEAR(clear_module_state->__pyx_n_s_name_2); - Py_CLEAR(clear_module_state->__pyx_n_s_np); - Py_CLEAR(clear_module_state->__pyx_n_s_numpy); - Py_CLEAR(clear_module_state->__pyx_kp_s_numpy_core_multiarray_failed_to); - Py_CLEAR(clear_module_state->__pyx_kp_s_numpy_core_umath_failed_to_impor); Py_CLEAR(clear_module_state->__pyx_n_s_overlap_dict); Py_CLEAR(clear_module_state->__pyx_n_s_range); Py_CLEAR(clear_module_state->__pyx_n_s_robot_links); Py_CLEAR(clear_module_state->__pyx_n_s_robot_name); Py_CLEAR(clear_module_state->__pyx_n_s_robot_names); - Py_CLEAR(clear_module_state->__pyx_n_s_sliced_link_name); Py_CLEAR(clear_module_state->__pyx_n_s_sliced_links); - Py_CLEAR(clear_module_state->__pyx_n_s_spec); Py_CLEAR(clear_module_state->__pyx_n_s_test); Py_CLEAR(clear_module_state->__pyx_n_s_test_2); Py_CLEAR(clear_module_state->__pyx_n_s_val1); Py_CLEAR(clear_module_state->__pyx_n_s_val2); Py_CLEAR(clear_module_state->__pyx_int_0); Py_CLEAR(clear_module_state->__pyx_tuple_); - Py_CLEAR(clear_module_state->__pyx_tuple__2); - Py_CLEAR(clear_module_state->__pyx_tuple__4); - Py_CLEAR(clear_module_state->__pyx_tuple__6); - Py_CLEAR(clear_module_state->__pyx_tuple__8); - Py_CLEAR(clear_module_state->__pyx_tuple__10); - Py_CLEAR(clear_module_state->__pyx_codeobj__5); - Py_CLEAR(clear_module_state->__pyx_codeobj__7); - Py_CLEAR(clear_module_state->__pyx_codeobj__9); - Py_CLEAR(clear_module_state->__pyx_codeobj__11); + Py_CLEAR(clear_module_state->__pyx_tuple__3); + Py_CLEAR(clear_module_state->__pyx_tuple__5); + Py_CLEAR(clear_module_state->__pyx_codeobj__2); + Py_CLEAR(clear_module_state->__pyx_codeobj__4); + Py_CLEAR(clear_module_state->__pyx_codeobj__6); return 0; } #endif @@ -2927,77 +2328,41 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #ifdef __Pyx_FusedFunction_USED Py_VISIT(traverse_module_state->__pyx_FusedFunctionType); #endif - Py_VISIT(traverse_module_state->__pyx_ptype_7cpython_4type_type); - Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_dtype); - Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_flatiter); - Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_broadcast); - Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_ndarray); - Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_generic); - Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_number); - Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_integer); - Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_signedinteger); - Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_unsignedinteger); - Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_inexact); - Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_floating); - Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_complexfloating); - Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_flexible); - Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_character); - Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_ufunc); - Py_VISIT(traverse_module_state->__pyx_n_s_DTYPE); - Py_VISIT(traverse_module_state->__pyx_n_s_ImportError); - Py_VISIT(traverse_module_state->__pyx_n_s__12); - Py_VISIT(traverse_module_state->__pyx_n_s__3); + Py_VISIT(traverse_module_state->__pyx_n_s__7); Py_VISIT(traverse_module_state->__pyx_kp_s_armer_cython_collision_handler_p); Py_VISIT(traverse_module_state->__pyx_n_s_asyncio_coroutines); Py_VISIT(traverse_module_state->__pyx_n_s_check_links); Py_VISIT(traverse_module_state->__pyx_n_s_cline_in_traceback); - Py_VISIT(traverse_module_state->__pyx_n_s_closest_dist_query); Py_VISIT(traverse_module_state->__pyx_n_s_closest_point); Py_VISIT(traverse_module_state->__pyx_n_s_col_check); - Py_VISIT(traverse_module_state->__pyx_n_s_col_dict); - Py_VISIT(traverse_module_state->__pyx_n_s_col_link_name_len); - Py_VISIT(traverse_module_state->__pyx_n_s_col_link_names); Py_VISIT(traverse_module_state->__pyx_n_s_collision); Py_VISIT(traverse_module_state->__pyx_n_s_collision_handler); Py_VISIT(traverse_module_state->__pyx_n_s_copy); - Py_VISIT(traverse_module_state->__pyx_n_s_float64); Py_VISIT(traverse_module_state->__pyx_n_s_global_check); Py_VISIT(traverse_module_state->__pyx_n_s_global_dict); - Py_VISIT(traverse_module_state->__pyx_n_s_import); - Py_VISIT(traverse_module_state->__pyx_n_s_initializing); Py_VISIT(traverse_module_state->__pyx_n_s_is_coroutine); Py_VISIT(traverse_module_state->__pyx_n_s_len_links); Py_VISIT(traverse_module_state->__pyx_n_s_len_robots); Py_VISIT(traverse_module_state->__pyx_n_s_main); Py_VISIT(traverse_module_state->__pyx_n_s_name); Py_VISIT(traverse_module_state->__pyx_n_s_name_2); - Py_VISIT(traverse_module_state->__pyx_n_s_np); - Py_VISIT(traverse_module_state->__pyx_n_s_numpy); - Py_VISIT(traverse_module_state->__pyx_kp_s_numpy_core_multiarray_failed_to); - Py_VISIT(traverse_module_state->__pyx_kp_s_numpy_core_umath_failed_to_impor); Py_VISIT(traverse_module_state->__pyx_n_s_overlap_dict); Py_VISIT(traverse_module_state->__pyx_n_s_range); Py_VISIT(traverse_module_state->__pyx_n_s_robot_links); Py_VISIT(traverse_module_state->__pyx_n_s_robot_name); Py_VISIT(traverse_module_state->__pyx_n_s_robot_names); - Py_VISIT(traverse_module_state->__pyx_n_s_sliced_link_name); Py_VISIT(traverse_module_state->__pyx_n_s_sliced_links); - Py_VISIT(traverse_module_state->__pyx_n_s_spec); Py_VISIT(traverse_module_state->__pyx_n_s_test); Py_VISIT(traverse_module_state->__pyx_n_s_test_2); Py_VISIT(traverse_module_state->__pyx_n_s_val1); Py_VISIT(traverse_module_state->__pyx_n_s_val2); Py_VISIT(traverse_module_state->__pyx_int_0); Py_VISIT(traverse_module_state->__pyx_tuple_); - Py_VISIT(traverse_module_state->__pyx_tuple__2); - Py_VISIT(traverse_module_state->__pyx_tuple__4); - Py_VISIT(traverse_module_state->__pyx_tuple__6); - Py_VISIT(traverse_module_state->__pyx_tuple__8); - Py_VISIT(traverse_module_state->__pyx_tuple__10); - Py_VISIT(traverse_module_state->__pyx_codeobj__5); - Py_VISIT(traverse_module_state->__pyx_codeobj__7); - Py_VISIT(traverse_module_state->__pyx_codeobj__9); - Py_VISIT(traverse_module_state->__pyx_codeobj__11); + Py_VISIT(traverse_module_state->__pyx_tuple__3); + Py_VISIT(traverse_module_state->__pyx_tuple__5); + Py_VISIT(traverse_module_state->__pyx_codeobj__2); + Py_VISIT(traverse_module_state->__pyx_codeobj__4); + Py_VISIT(traverse_module_state->__pyx_codeobj__6); return 0; } #endif @@ -3038,1896 +2403,44 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #endif #if CYTHON_USE_MODULE_STATE #endif -#if CYTHON_USE_MODULE_STATE -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#define __pyx_ptype_7cpython_4type_type __pyx_mstate_global->__pyx_ptype_7cpython_4type_type -#if CYTHON_USE_MODULE_STATE -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#define __pyx_ptype_5numpy_dtype __pyx_mstate_global->__pyx_ptype_5numpy_dtype -#define __pyx_ptype_5numpy_flatiter __pyx_mstate_global->__pyx_ptype_5numpy_flatiter -#define __pyx_ptype_5numpy_broadcast __pyx_mstate_global->__pyx_ptype_5numpy_broadcast -#define __pyx_ptype_5numpy_ndarray __pyx_mstate_global->__pyx_ptype_5numpy_ndarray -#define __pyx_ptype_5numpy_generic __pyx_mstate_global->__pyx_ptype_5numpy_generic -#define __pyx_ptype_5numpy_number __pyx_mstate_global->__pyx_ptype_5numpy_number -#define __pyx_ptype_5numpy_integer __pyx_mstate_global->__pyx_ptype_5numpy_integer -#define __pyx_ptype_5numpy_signedinteger __pyx_mstate_global->__pyx_ptype_5numpy_signedinteger -#define __pyx_ptype_5numpy_unsignedinteger __pyx_mstate_global->__pyx_ptype_5numpy_unsignedinteger -#define __pyx_ptype_5numpy_inexact __pyx_mstate_global->__pyx_ptype_5numpy_inexact -#define __pyx_ptype_5numpy_floating __pyx_mstate_global->__pyx_ptype_5numpy_floating -#define __pyx_ptype_5numpy_complexfloating __pyx_mstate_global->__pyx_ptype_5numpy_complexfloating -#define __pyx_ptype_5numpy_flexible __pyx_mstate_global->__pyx_ptype_5numpy_flexible -#define __pyx_ptype_5numpy_character __pyx_mstate_global->__pyx_ptype_5numpy_character -#define __pyx_ptype_5numpy_ufunc __pyx_mstate_global->__pyx_ptype_5numpy_ufunc -#if CYTHON_USE_MODULE_STATE -#endif -#define __pyx_n_s_DTYPE __pyx_mstate_global->__pyx_n_s_DTYPE -#define __pyx_n_s_ImportError __pyx_mstate_global->__pyx_n_s_ImportError -#define __pyx_n_s__12 __pyx_mstate_global->__pyx_n_s__12 -#define __pyx_n_s__3 __pyx_mstate_global->__pyx_n_s__3 -#define __pyx_kp_s_armer_cython_collision_handler_p __pyx_mstate_global->__pyx_kp_s_armer_cython_collision_handler_p -#define __pyx_n_s_asyncio_coroutines __pyx_mstate_global->__pyx_n_s_asyncio_coroutines -#define __pyx_n_s_check_links __pyx_mstate_global->__pyx_n_s_check_links -#define __pyx_n_s_cline_in_traceback __pyx_mstate_global->__pyx_n_s_cline_in_traceback -#define __pyx_n_s_closest_dist_query __pyx_mstate_global->__pyx_n_s_closest_dist_query -#define __pyx_n_s_closest_point __pyx_mstate_global->__pyx_n_s_closest_point -#define __pyx_n_s_col_check __pyx_mstate_global->__pyx_n_s_col_check -#define __pyx_n_s_col_dict __pyx_mstate_global->__pyx_n_s_col_dict -#define __pyx_n_s_col_link_name_len __pyx_mstate_global->__pyx_n_s_col_link_name_len -#define __pyx_n_s_col_link_names __pyx_mstate_global->__pyx_n_s_col_link_names -#define __pyx_n_s_collision __pyx_mstate_global->__pyx_n_s_collision -#define __pyx_n_s_collision_handler __pyx_mstate_global->__pyx_n_s_collision_handler -#define __pyx_n_s_copy __pyx_mstate_global->__pyx_n_s_copy -#define __pyx_n_s_float64 __pyx_mstate_global->__pyx_n_s_float64 -#define __pyx_n_s_global_check __pyx_mstate_global->__pyx_n_s_global_check -#define __pyx_n_s_global_dict __pyx_mstate_global->__pyx_n_s_global_dict -#define __pyx_n_s_import __pyx_mstate_global->__pyx_n_s_import -#define __pyx_n_s_initializing __pyx_mstate_global->__pyx_n_s_initializing -#define __pyx_n_s_is_coroutine __pyx_mstate_global->__pyx_n_s_is_coroutine -#define __pyx_n_s_len_links __pyx_mstate_global->__pyx_n_s_len_links -#define __pyx_n_s_len_robots __pyx_mstate_global->__pyx_n_s_len_robots -#define __pyx_n_s_main __pyx_mstate_global->__pyx_n_s_main -#define __pyx_n_s_name __pyx_mstate_global->__pyx_n_s_name -#define __pyx_n_s_name_2 __pyx_mstate_global->__pyx_n_s_name_2 -#define __pyx_n_s_np __pyx_mstate_global->__pyx_n_s_np -#define __pyx_n_s_numpy __pyx_mstate_global->__pyx_n_s_numpy -#define __pyx_kp_s_numpy_core_multiarray_failed_to __pyx_mstate_global->__pyx_kp_s_numpy_core_multiarray_failed_to -#define __pyx_kp_s_numpy_core_umath_failed_to_impor __pyx_mstate_global->__pyx_kp_s_numpy_core_umath_failed_to_impor -#define __pyx_n_s_overlap_dict __pyx_mstate_global->__pyx_n_s_overlap_dict -#define __pyx_n_s_range __pyx_mstate_global->__pyx_n_s_range -#define __pyx_n_s_robot_links __pyx_mstate_global->__pyx_n_s_robot_links -#define __pyx_n_s_robot_name __pyx_mstate_global->__pyx_n_s_robot_name -#define __pyx_n_s_robot_names __pyx_mstate_global->__pyx_n_s_robot_names -#define __pyx_n_s_sliced_link_name __pyx_mstate_global->__pyx_n_s_sliced_link_name -#define __pyx_n_s_sliced_links __pyx_mstate_global->__pyx_n_s_sliced_links -#define __pyx_n_s_spec __pyx_mstate_global->__pyx_n_s_spec -#define __pyx_n_s_test __pyx_mstate_global->__pyx_n_s_test -#define __pyx_n_s_test_2 __pyx_mstate_global->__pyx_n_s_test_2 -#define __pyx_n_s_val1 __pyx_mstate_global->__pyx_n_s_val1 -#define __pyx_n_s_val2 __pyx_mstate_global->__pyx_n_s_val2 -#define __pyx_int_0 __pyx_mstate_global->__pyx_int_0 -#define __pyx_tuple_ __pyx_mstate_global->__pyx_tuple_ -#define __pyx_tuple__2 __pyx_mstate_global->__pyx_tuple__2 -#define __pyx_tuple__4 __pyx_mstate_global->__pyx_tuple__4 -#define __pyx_tuple__6 __pyx_mstate_global->__pyx_tuple__6 -#define __pyx_tuple__8 __pyx_mstate_global->__pyx_tuple__8 -#define __pyx_tuple__10 __pyx_mstate_global->__pyx_tuple__10 -#define __pyx_codeobj__5 __pyx_mstate_global->__pyx_codeobj__5 -#define __pyx_codeobj__7 __pyx_mstate_global->__pyx_codeobj__7 -#define __pyx_codeobj__9 __pyx_mstate_global->__pyx_codeobj__9 -#define __pyx_codeobj__11 __pyx_mstate_global->__pyx_codeobj__11 -/* #### Code section: module_code ### */ - -/* "../../../../../../usr/local/lib/python3.8/dist-packages/numpy/__init__.cython-30.pxd":245 - * - * @property - * cdef inline PyObject* base(self) nogil: # <<<<<<<<<<<<<< - * """Returns a borrowed reference to the object owning the data/memory. - * """ - */ - -static CYTHON_INLINE PyObject *__pyx_f_5numpy_7ndarray_4base_base(PyArrayObject *__pyx_v_self) { - PyObject *__pyx_r; - - /* "../../../../../../usr/local/lib/python3.8/dist-packages/numpy/__init__.cython-30.pxd":248 - * """Returns a borrowed reference to the object owning the data/memory. - * """ - * return PyArray_BASE(self) # <<<<<<<<<<<<<< - * - * @property - */ - __pyx_r = PyArray_BASE(__pyx_v_self); - goto __pyx_L0; - - /* "../../../../../../usr/local/lib/python3.8/dist-packages/numpy/__init__.cython-30.pxd":245 - * - * @property - * cdef inline PyObject* base(self) nogil: # <<<<<<<<<<<<<< - * """Returns a borrowed reference to the object owning the data/memory. - * """ - */ - - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} - -/* "../../../../../../usr/local/lib/python3.8/dist-packages/numpy/__init__.cython-30.pxd":251 - * - * @property - * cdef inline dtype descr(self): # <<<<<<<<<<<<<< - * """Returns an owned reference to the dtype of the array. - * """ - */ - -static CYTHON_INLINE PyArray_Descr *__pyx_f_5numpy_7ndarray_5descr_descr(PyArrayObject *__pyx_v_self) { - PyArray_Descr *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyArray_Descr *__pyx_t_1; - __Pyx_RefNannySetupContext("descr", 1); - - /* "../../../../../../usr/local/lib/python3.8/dist-packages/numpy/__init__.cython-30.pxd":254 - * """Returns an owned reference to the dtype of the array. - * """ - * return PyArray_DESCR(self) # <<<<<<<<<<<<<< - * - * @property - */ - __Pyx_XDECREF((PyObject *)__pyx_r); - __pyx_t_1 = PyArray_DESCR(__pyx_v_self); - __Pyx_INCREF((PyObject *)((PyArray_Descr *)__pyx_t_1)); - __pyx_r = ((PyArray_Descr *)__pyx_t_1); - goto __pyx_L0; - - /* "../../../../../../usr/local/lib/python3.8/dist-packages/numpy/__init__.cython-30.pxd":251 - * - * @property - * cdef inline dtype descr(self): # <<<<<<<<<<<<<< - * """Returns an owned reference to the dtype of the array. - * """ - */ - - /* function exit code */ - __pyx_L0:; - __Pyx_XGIVEREF((PyObject *)__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "../../../../../../usr/local/lib/python3.8/dist-packages/numpy/__init__.cython-30.pxd":257 - * - * @property - * cdef inline int ndim(self) nogil: # <<<<<<<<<<<<<< - * """Returns the number of dimensions in the array. - * """ - */ - -static CYTHON_INLINE int __pyx_f_5numpy_7ndarray_4ndim_ndim(PyArrayObject *__pyx_v_self) { - int __pyx_r; - - /* "../../../../../../usr/local/lib/python3.8/dist-packages/numpy/__init__.cython-30.pxd":260 - * """Returns the number of dimensions in the array. - * """ - * return PyArray_NDIM(self) # <<<<<<<<<<<<<< - * - * @property - */ - __pyx_r = PyArray_NDIM(__pyx_v_self); - goto __pyx_L0; - - /* "../../../../../../usr/local/lib/python3.8/dist-packages/numpy/__init__.cython-30.pxd":257 - * - * @property - * cdef inline int ndim(self) nogil: # <<<<<<<<<<<<<< - * """Returns the number of dimensions in the array. - * """ - */ - - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} - -/* "../../../../../../usr/local/lib/python3.8/dist-packages/numpy/__init__.cython-30.pxd":263 - * - * @property - * cdef inline npy_intp *shape(self) nogil: # <<<<<<<<<<<<<< - * """Returns a pointer to the dimensions/shape of the array. - * The number of elements matches the number of dimensions of the array (ndim). - */ - -static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_5shape_shape(PyArrayObject *__pyx_v_self) { - npy_intp *__pyx_r; - - /* "../../../../../../usr/local/lib/python3.8/dist-packages/numpy/__init__.cython-30.pxd":268 - * Can return NULL for 0-dimensional arrays. - * """ - * return PyArray_DIMS(self) # <<<<<<<<<<<<<< - * - * @property - */ - __pyx_r = PyArray_DIMS(__pyx_v_self); - goto __pyx_L0; - - /* "../../../../../../usr/local/lib/python3.8/dist-packages/numpy/__init__.cython-30.pxd":263 - * - * @property - * cdef inline npy_intp *shape(self) nogil: # <<<<<<<<<<<<<< - * """Returns a pointer to the dimensions/shape of the array. - * The number of elements matches the number of dimensions of the array (ndim). - */ - - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} - -/* "../../../../../../usr/local/lib/python3.8/dist-packages/numpy/__init__.cython-30.pxd":271 - * - * @property - * cdef inline npy_intp *strides(self) nogil: # <<<<<<<<<<<<<< - * """Returns a pointer to the strides of the array. - * The number of elements matches the number of dimensions of the array (ndim). - */ - -static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_7strides_strides(PyArrayObject *__pyx_v_self) { - npy_intp *__pyx_r; - - /* "../../../../../../usr/local/lib/python3.8/dist-packages/numpy/__init__.cython-30.pxd":275 - * The number of elements matches the number of dimensions of the array (ndim). - * """ - * return PyArray_STRIDES(self) # <<<<<<<<<<<<<< - * - * @property - */ - __pyx_r = PyArray_STRIDES(__pyx_v_self); - goto __pyx_L0; - - /* "../../../../../../usr/local/lib/python3.8/dist-packages/numpy/__init__.cython-30.pxd":271 - * - * @property - * cdef inline npy_intp *strides(self) nogil: # <<<<<<<<<<<<<< - * """Returns a pointer to the strides of the array. - * The number of elements matches the number of dimensions of the array (ndim). - */ - - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} - -/* "../../../../../../usr/local/lib/python3.8/dist-packages/numpy/__init__.cython-30.pxd":278 - * - * @property - * cdef inline npy_intp size(self) nogil: # <<<<<<<<<<<<<< - * """Returns the total size (in number of elements) of the array. - * """ - */ - -static CYTHON_INLINE npy_intp __pyx_f_5numpy_7ndarray_4size_size(PyArrayObject *__pyx_v_self) { - npy_intp __pyx_r; - - /* "../../../../../../usr/local/lib/python3.8/dist-packages/numpy/__init__.cython-30.pxd":281 - * """Returns the total size (in number of elements) of the array. - * """ - * return PyArray_SIZE(self) # <<<<<<<<<<<<<< - * - * @property - */ - __pyx_r = PyArray_SIZE(__pyx_v_self); - goto __pyx_L0; - - /* "../../../../../../usr/local/lib/python3.8/dist-packages/numpy/__init__.cython-30.pxd":278 - * - * @property - * cdef inline npy_intp size(self) nogil: # <<<<<<<<<<<<<< - * """Returns the total size (in number of elements) of the array. - * """ - */ - - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} - -/* "../../../../../../usr/local/lib/python3.8/dist-packages/numpy/__init__.cython-30.pxd":284 - * - * @property - * cdef inline char* data(self) nogil: # <<<<<<<<<<<<<< - * """The pointer to the data buffer as a char*. - * This is provided for legacy reasons to avoid direct struct field access. - */ - -static CYTHON_INLINE char *__pyx_f_5numpy_7ndarray_4data_data(PyArrayObject *__pyx_v_self) { - char *__pyx_r; - - /* "../../../../../../usr/local/lib/python3.8/dist-packages/numpy/__init__.cython-30.pxd":290 - * of `PyArray_DATA()` instead, which returns a 'void*'. - * """ - * return PyArray_BYTES(self) # <<<<<<<<<<<<<< - * - * ctypedef unsigned char npy_bool - */ - __pyx_r = PyArray_BYTES(__pyx_v_self); - goto __pyx_L0; - - /* "../../../../../../usr/local/lib/python3.8/dist-packages/numpy/__init__.cython-30.pxd":284 - * - * @property - * cdef inline char* data(self) nogil: # <<<<<<<<<<<<<< - * """The pointer to the data buffer as a char*. - * This is provided for legacy reasons to avoid direct struct field access. - */ - - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} - -/* "../../../../../../usr/local/lib/python3.8/dist-packages/numpy/__init__.cython-30.pxd":776 - * ctypedef npy_cdouble complex_t - * - * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(1, a) - * - */ - -static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 1); - - /* "../../../../../../usr/local/lib/python3.8/dist-packages/numpy/__init__.cython-30.pxd":777 - * - * cdef inline object PyArray_MultiIterNew1(a): - * return PyArray_MultiIterNew(1, a) # <<<<<<<<<<<<<< - * - * cdef inline object PyArray_MultiIterNew2(a, b): - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 777, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - /* "../../../../../../usr/local/lib/python3.8/dist-packages/numpy/__init__.cython-30.pxd":776 - * ctypedef npy_cdouble complex_t - * - * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(1, a) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "../../../../../../usr/local/lib/python3.8/dist-packages/numpy/__init__.cython-30.pxd":779 - * return PyArray_MultiIterNew(1, a) - * - * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(2, a, b) - * - */ - -static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 1); - - /* "../../../../../../usr/local/lib/python3.8/dist-packages/numpy/__init__.cython-30.pxd":780 - * - * cdef inline object PyArray_MultiIterNew2(a, b): - * return PyArray_MultiIterNew(2, a, b) # <<<<<<<<<<<<<< - * - * 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, 780, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - /* "../../../../../../usr/local/lib/python3.8/dist-packages/numpy/__init__.cython-30.pxd":779 - * return PyArray_MultiIterNew(1, a) - * - * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(2, a, b) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "../../../../../../usr/local/lib/python3.8/dist-packages/numpy/__init__.cython-30.pxd":782 - * return PyArray_MultiIterNew(2, a, b) - * - * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(3, a, b, c) - * - */ - -static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 1); - - /* "../../../../../../usr/local/lib/python3.8/dist-packages/numpy/__init__.cython-30.pxd":783 - * - * cdef inline object PyArray_MultiIterNew3(a, b, c): - * return PyArray_MultiIterNew(3, a, b, c) # <<<<<<<<<<<<<< - * - * 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, 783, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - /* "../../../../../../usr/local/lib/python3.8/dist-packages/numpy/__init__.cython-30.pxd":782 - * return PyArray_MultiIterNew(2, a, b) - * - * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(3, a, b, c) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "../../../../../../usr/local/lib/python3.8/dist-packages/numpy/__init__.cython-30.pxd":785 - * return PyArray_MultiIterNew(3, a, b, c) - * - * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(4, a, b, c, d) - * - */ - -static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 1); - - /* "../../../../../../usr/local/lib/python3.8/dist-packages/numpy/__init__.cython-30.pxd":786 - * - * cdef inline object PyArray_MultiIterNew4(a, b, c, d): - * return PyArray_MultiIterNew(4, a, b, c, d) # <<<<<<<<<<<<<< - * - * 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, 786, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - /* "../../../../../../usr/local/lib/python3.8/dist-packages/numpy/__init__.cython-30.pxd":785 - * return PyArray_MultiIterNew(3, a, b, c) - * - * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(4, a, b, c, d) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "../../../../../../usr/local/lib/python3.8/dist-packages/numpy/__init__.cython-30.pxd":788 - * return PyArray_MultiIterNew(4, a, b, c, d) - * - * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(5, a, b, c, d, e) - * - */ - -static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d, PyObject *__pyx_v_e) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 1); - - /* "../../../../../../usr/local/lib/python3.8/dist-packages/numpy/__init__.cython-30.pxd":789 - * - * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): - * return PyArray_MultiIterNew(5, a, b, c, d, e) # <<<<<<<<<<<<<< - * - * 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, 789, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - /* "../../../../../../usr/local/lib/python3.8/dist-packages/numpy/__init__.cython-30.pxd":788 - * return PyArray_MultiIterNew(4, a, b, c, d) - * - * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(5, a, b, c, d, e) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "../../../../../../usr/local/lib/python3.8/dist-packages/numpy/__init__.cython-30.pxd":791 - * return PyArray_MultiIterNew(5, a, b, c, d, e) - * - * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<< - * if PyDataType_HASSUBARRAY(d): - * return d.subarray.shape - */ - -static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__pyx_v_d) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - __Pyx_RefNannySetupContext("PyDataType_SHAPE", 1); - - /* "../../../../../../usr/local/lib/python3.8/dist-packages/numpy/__init__.cython-30.pxd":792 - * - * cdef inline tuple PyDataType_SHAPE(dtype d): - * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<< - * return d.subarray.shape - * else: - */ - __pyx_t_1 = PyDataType_HASSUBARRAY(__pyx_v_d); - if (__pyx_t_1) { - - /* "../../../../../../usr/local/lib/python3.8/dist-packages/numpy/__init__.cython-30.pxd":793 - * cdef inline tuple PyDataType_SHAPE(dtype d): - * if PyDataType_HASSUBARRAY(d): - * return d.subarray.shape # <<<<<<<<<<<<<< - * else: - * return () - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject*)__pyx_v_d->subarray->shape)); - __pyx_r = ((PyObject*)__pyx_v_d->subarray->shape); - goto __pyx_L0; - - /* "../../../../../../usr/local/lib/python3.8/dist-packages/numpy/__init__.cython-30.pxd":792 - * - * cdef inline tuple PyDataType_SHAPE(dtype d): - * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<< - * return d.subarray.shape - * else: - */ - } - - /* "../../../../../../usr/local/lib/python3.8/dist-packages/numpy/__init__.cython-30.pxd":795 - * return d.subarray.shape - * else: - * return () # <<<<<<<<<<<<<< - * - * - */ - /*else*/ { - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_empty_tuple); - __pyx_r = __pyx_empty_tuple; - goto __pyx_L0; - } - - /* "../../../../../../usr/local/lib/python3.8/dist-packages/numpy/__init__.cython-30.pxd":791 - * return PyArray_MultiIterNew(5, a, b, c, d, e) - * - * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<< - * if PyDataType_HASSUBARRAY(d): - * return d.subarray.shape - */ - - /* function exit code */ - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "../../../../../../usr/local/lib/python3.8/dist-packages/numpy/__init__.cython-30.pxd":970 - * int _import_umath() except -1 - * - * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< - * Py_INCREF(base) # important to do this before stealing the reference below! - * PyArray_SetBaseObject(arr, base) - */ - -static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) { - - /* "../../../../../../usr/local/lib/python3.8/dist-packages/numpy/__init__.cython-30.pxd":971 - * - * cdef inline void set_array_base(ndarray arr, object base): - * Py_INCREF(base) # important to do this before stealing the reference below! # <<<<<<<<<<<<<< - * PyArray_SetBaseObject(arr, base) - * - */ - Py_INCREF(__pyx_v_base); - - /* "../../../../../../usr/local/lib/python3.8/dist-packages/numpy/__init__.cython-30.pxd":972 - * cdef inline void set_array_base(ndarray arr, object base): - * Py_INCREF(base) # important to do this before stealing the reference below! - * PyArray_SetBaseObject(arr, base) # <<<<<<<<<<<<<< - * - * cdef inline object get_array_base(ndarray arr): - */ - (void)(PyArray_SetBaseObject(__pyx_v_arr, __pyx_v_base)); - - /* "../../../../../../usr/local/lib/python3.8/dist-packages/numpy/__init__.cython-30.pxd":970 - * int _import_umath() except -1 - * - * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< - * Py_INCREF(base) # important to do this before stealing the reference below! - * PyArray_SetBaseObject(arr, base) - */ - - /* function exit code */ -} - -/* "../../../../../../usr/local/lib/python3.8/dist-packages/numpy/__init__.cython-30.pxd":974 - * PyArray_SetBaseObject(arr, base) - * - * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< - * base = PyArray_BASE(arr) - * if base is NULL: - */ - -static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) { - PyObject *__pyx_v_base; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - __Pyx_RefNannySetupContext("get_array_base", 1); - - /* "../../../../../../usr/local/lib/python3.8/dist-packages/numpy/__init__.cython-30.pxd":975 - * - * cdef inline object get_array_base(ndarray arr): - * base = PyArray_BASE(arr) # <<<<<<<<<<<<<< - * if base is NULL: - * return None - */ - __pyx_v_base = PyArray_BASE(__pyx_v_arr); - - /* "../../../../../../usr/local/lib/python3.8/dist-packages/numpy/__init__.cython-30.pxd":976 - * cdef inline object get_array_base(ndarray arr): - * base = PyArray_BASE(arr) - * if base is NULL: # <<<<<<<<<<<<<< - * return None - * return base - */ - __pyx_t_1 = (__pyx_v_base == NULL); - if (__pyx_t_1) { - - /* "../../../../../../usr/local/lib/python3.8/dist-packages/numpy/__init__.cython-30.pxd":977 - * base = PyArray_BASE(arr) - * if base is NULL: - * return None # <<<<<<<<<<<<<< - * return base - * - */ - __Pyx_XDECREF(__pyx_r); - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - - /* "../../../../../../usr/local/lib/python3.8/dist-packages/numpy/__init__.cython-30.pxd":976 - * cdef inline object get_array_base(ndarray arr): - * base = PyArray_BASE(arr) - * if base is NULL: # <<<<<<<<<<<<<< - * return None - * return base - */ - } - - /* "../../../../../../usr/local/lib/python3.8/dist-packages/numpy/__init__.cython-30.pxd":978 - * if base is NULL: - * return None - * return base # <<<<<<<<<<<<<< - * - * # Versions of the import_* functions which are more suitable for - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_base)); - __pyx_r = ((PyObject *)__pyx_v_base); - goto __pyx_L0; - - /* "../../../../../../usr/local/lib/python3.8/dist-packages/numpy/__init__.cython-30.pxd":974 - * PyArray_SetBaseObject(arr, base) - * - * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< - * base = PyArray_BASE(arr) - * if base is NULL: - */ - - /* function exit code */ - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "../../../../../../usr/local/lib/python3.8/dist-packages/numpy/__init__.cython-30.pxd":982 - * # Versions of the import_* functions which are more suitable for - * # Cython code. - * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< - * try: - * __pyx_import_array() - */ - -static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { - int __pyx_r; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; - PyObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; - PyObject *__pyx_t_7 = NULL; - PyObject *__pyx_t_8 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("import_array", 1); - - /* "../../../../../../usr/local/lib/python3.8/dist-packages/numpy/__init__.cython-30.pxd":983 - * # Cython code. - * cdef inline int import_array() except -1: - * try: # <<<<<<<<<<<<<< - * __pyx_import_array() - * except Exception: - */ - { - __Pyx_PyThreadState_declare - __Pyx_PyThreadState_assign - __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); - __Pyx_XGOTREF(__pyx_t_1); - __Pyx_XGOTREF(__pyx_t_2); - __Pyx_XGOTREF(__pyx_t_3); - /*try:*/ { - - /* "../../../../../../usr/local/lib/python3.8/dist-packages/numpy/__init__.cython-30.pxd":984 - * cdef inline int import_array() except -1: - * try: - * __pyx_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, 984, __pyx_L3_error) - - /* "../../../../../../usr/local/lib/python3.8/dist-packages/numpy/__init__.cython-30.pxd":983 - * # Cython code. - * cdef inline int import_array() except -1: - * try: # <<<<<<<<<<<<<< - * __pyx_import_array() - * except Exception: - */ - } - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L8_try_end; - __pyx_L3_error:; - - /* "../../../../../../usr/local/lib/python3.8/dist-packages/numpy/__init__.cython-30.pxd":985 - * try: - * __pyx_import_array() - * except Exception: # <<<<<<<<<<<<<< - * raise ImportError("numpy.core.multiarray failed to import") - * - */ - __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); - if (__pyx_t_4) { - __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 985, __pyx_L5_except_error) - __Pyx_XGOTREF(__pyx_t_5); - __Pyx_XGOTREF(__pyx_t_6); - __Pyx_XGOTREF(__pyx_t_7); - - /* "../../../../../../usr/local/lib/python3.8/dist-packages/numpy/__init__.cython-30.pxd":986 - * __pyx_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_, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 986, __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, 986, __pyx_L5_except_error) - } - goto __pyx_L5_except_error; - - /* "../../../../../../usr/local/lib/python3.8/dist-packages/numpy/__init__.cython-30.pxd":983 - * # Cython code. - * cdef inline int import_array() except -1: - * try: # <<<<<<<<<<<<<< - * __pyx_import_array() - * except Exception: - */ - __pyx_L5_except_error:; - __Pyx_XGIVEREF(__pyx_t_1); - __Pyx_XGIVEREF(__pyx_t_2); - __Pyx_XGIVEREF(__pyx_t_3); - __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); - goto __pyx_L1_error; - __pyx_L8_try_end:; - } - - /* "../../../../../../usr/local/lib/python3.8/dist-packages/numpy/__init__.cython-30.pxd":982 - * # Versions of the import_* functions which are more suitable for - * # Cython code. - * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< - * try: - * __pyx_import_array() - */ - - /* function exit code */ - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_XDECREF(__pyx_t_8); - __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "../../../../../../usr/local/lib/python3.8/dist-packages/numpy/__init__.cython-30.pxd":988 - * raise ImportError("numpy.core.multiarray failed to import") - * - * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< - * try: - * _import_umath() - */ - -static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { - int __pyx_r; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; - PyObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; - PyObject *__pyx_t_7 = NULL; - PyObject *__pyx_t_8 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("import_umath", 1); - - /* "../../../../../../usr/local/lib/python3.8/dist-packages/numpy/__init__.cython-30.pxd":989 - * - * cdef inline int import_umath() except -1: - * try: # <<<<<<<<<<<<<< - * _import_umath() - * except Exception: - */ - { - __Pyx_PyThreadState_declare - __Pyx_PyThreadState_assign - __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); - __Pyx_XGOTREF(__pyx_t_1); - __Pyx_XGOTREF(__pyx_t_2); - __Pyx_XGOTREF(__pyx_t_3); - /*try:*/ { - - /* "../../../../../../usr/local/lib/python3.8/dist-packages/numpy/__init__.cython-30.pxd":990 - * 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, 990, __pyx_L3_error) - - /* "../../../../../../usr/local/lib/python3.8/dist-packages/numpy/__init__.cython-30.pxd":989 - * - * cdef inline int import_umath() except -1: - * try: # <<<<<<<<<<<<<< - * _import_umath() - * except Exception: - */ - } - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L8_try_end; - __pyx_L3_error:; - - /* "../../../../../../usr/local/lib/python3.8/dist-packages/numpy/__init__.cython-30.pxd":991 - * try: - * _import_umath() - * except Exception: # <<<<<<<<<<<<<< - * raise ImportError("numpy.core.umath failed to import") - * - */ - __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); - if (__pyx_t_4) { - __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 991, __pyx_L5_except_error) - __Pyx_XGOTREF(__pyx_t_5); - __Pyx_XGOTREF(__pyx_t_6); - __Pyx_XGOTREF(__pyx_t_7); - - /* "../../../../../../usr/local/lib/python3.8/dist-packages/numpy/__init__.cython-30.pxd":992 - * _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__2, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 992, __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, 992, __pyx_L5_except_error) - } - goto __pyx_L5_except_error; - - /* "../../../../../../usr/local/lib/python3.8/dist-packages/numpy/__init__.cython-30.pxd":989 - * - * cdef inline int import_umath() except -1: - * try: # <<<<<<<<<<<<<< - * _import_umath() - * except Exception: - */ - __pyx_L5_except_error:; - __Pyx_XGIVEREF(__pyx_t_1); - __Pyx_XGIVEREF(__pyx_t_2); - __Pyx_XGIVEREF(__pyx_t_3); - __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); - goto __pyx_L1_error; - __pyx_L8_try_end:; - } - - /* "../../../../../../usr/local/lib/python3.8/dist-packages/numpy/__init__.cython-30.pxd":988 - * raise ImportError("numpy.core.multiarray failed to import") - * - * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< - * try: - * _import_umath() - */ - - /* function exit code */ - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_XDECREF(__pyx_t_8); - __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "../../../../../../usr/local/lib/python3.8/dist-packages/numpy/__init__.cython-30.pxd":994 - * raise ImportError("numpy.core.umath failed to import") - * - * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< - * try: - * _import_umath() - */ - -static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { - int __pyx_r; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; - PyObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; - PyObject *__pyx_t_7 = NULL; - PyObject *__pyx_t_8 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("import_ufunc", 1); - - /* "../../../../../../usr/local/lib/python3.8/dist-packages/numpy/__init__.cython-30.pxd":995 - * - * cdef inline int import_ufunc() except -1: - * try: # <<<<<<<<<<<<<< - * _import_umath() - * except Exception: - */ - { - __Pyx_PyThreadState_declare - __Pyx_PyThreadState_assign - __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); - __Pyx_XGOTREF(__pyx_t_1); - __Pyx_XGOTREF(__pyx_t_2); - __Pyx_XGOTREF(__pyx_t_3); - /*try:*/ { - - /* "../../../../../../usr/local/lib/python3.8/dist-packages/numpy/__init__.cython-30.pxd":996 - * 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, 996, __pyx_L3_error) - - /* "../../../../../../usr/local/lib/python3.8/dist-packages/numpy/__init__.cython-30.pxd":995 - * - * cdef inline int import_ufunc() except -1: - * try: # <<<<<<<<<<<<<< - * _import_umath() - * except Exception: - */ - } - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L8_try_end; - __pyx_L3_error:; - - /* "../../../../../../usr/local/lib/python3.8/dist-packages/numpy/__init__.cython-30.pxd":997 - * try: - * _import_umath() - * except Exception: # <<<<<<<<<<<<<< - * raise ImportError("numpy.core.umath failed to import") - * - */ - __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); - if (__pyx_t_4) { - __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 997, __pyx_L5_except_error) - __Pyx_XGOTREF(__pyx_t_5); - __Pyx_XGOTREF(__pyx_t_6); - __Pyx_XGOTREF(__pyx_t_7); - - /* "../../../../../../usr/local/lib/python3.8/dist-packages/numpy/__init__.cython-30.pxd":998 - * _import_umath() - * except Exception: - * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< - * - * - */ - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 998, __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, 998, __pyx_L5_except_error) - } - goto __pyx_L5_except_error; - - /* "../../../../../../usr/local/lib/python3.8/dist-packages/numpy/__init__.cython-30.pxd":995 - * - * cdef inline int import_ufunc() except -1: - * try: # <<<<<<<<<<<<<< - * _import_umath() - * except Exception: - */ - __pyx_L5_except_error:; - __Pyx_XGIVEREF(__pyx_t_1); - __Pyx_XGIVEREF(__pyx_t_2); - __Pyx_XGIVEREF(__pyx_t_3); - __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); - goto __pyx_L1_error; - __pyx_L8_try_end:; - } - - /* "../../../../../../usr/local/lib/python3.8/dist-packages/numpy/__init__.cython-30.pxd":994 - * raise ImportError("numpy.core.umath failed to import") - * - * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< - * try: - * _import_umath() - */ - - /* function exit code */ - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_XDECREF(__pyx_t_8); - __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "../../../../../../usr/local/lib/python3.8/dist-packages/numpy/__init__.cython-30.pxd":1001 - * - * - * cdef inline bint is_timedelta64_object(object obj): # <<<<<<<<<<<<<< - * """ - * Cython equivalent of `isinstance(obj, np.timedelta64)` - */ - -static CYTHON_INLINE int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_obj) { - int __pyx_r; - - /* "../../../../../../usr/local/lib/python3.8/dist-packages/numpy/__init__.cython-30.pxd":1013 - * bool - * """ - * return PyObject_TypeCheck(obj, &PyTimedeltaArrType_Type) # <<<<<<<<<<<<<< - * - * - */ - __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyTimedeltaArrType_Type)); - goto __pyx_L0; - - /* "../../../../../../usr/local/lib/python3.8/dist-packages/numpy/__init__.cython-30.pxd":1001 - * - * - * cdef inline bint is_timedelta64_object(object obj): # <<<<<<<<<<<<<< - * """ - * Cython equivalent of `isinstance(obj, np.timedelta64)` - */ - - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} - -/* "../../../../../../usr/local/lib/python3.8/dist-packages/numpy/__init__.cython-30.pxd":1016 - * - * - * cdef inline bint is_datetime64_object(object obj): # <<<<<<<<<<<<<< - * """ - * Cython equivalent of `isinstance(obj, np.datetime64)` - */ - -static CYTHON_INLINE int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_obj) { - int __pyx_r; - - /* "../../../../../../usr/local/lib/python3.8/dist-packages/numpy/__init__.cython-30.pxd":1028 - * bool - * """ - * return PyObject_TypeCheck(obj, &PyDatetimeArrType_Type) # <<<<<<<<<<<<<< - * - * - */ - __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyDatetimeArrType_Type)); - goto __pyx_L0; - - /* "../../../../../../usr/local/lib/python3.8/dist-packages/numpy/__init__.cython-30.pxd":1016 - * - * - * cdef inline bint is_datetime64_object(object obj): # <<<<<<<<<<<<<< - * """ - * Cython equivalent of `isinstance(obj, np.datetime64)` - */ - - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} - -/* "../../../../../../usr/local/lib/python3.8/dist-packages/numpy/__init__.cython-30.pxd":1031 - * - * - * cdef inline npy_datetime get_datetime64_value(object obj) nogil: # <<<<<<<<<<<<<< - * """ - * returns the int64 value underlying scalar numpy datetime64 object - */ - -static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject *__pyx_v_obj) { - npy_datetime __pyx_r; - - /* "../../../../../../usr/local/lib/python3.8/dist-packages/numpy/__init__.cython-30.pxd":1038 - * also needed. That can be found using `get_datetime64_unit`. - * """ - * return (obj).obval # <<<<<<<<<<<<<< - * - * - */ - __pyx_r = ((PyDatetimeScalarObject *)__pyx_v_obj)->obval; - goto __pyx_L0; - - /* "../../../../../../usr/local/lib/python3.8/dist-packages/numpy/__init__.cython-30.pxd":1031 - * - * - * cdef inline npy_datetime get_datetime64_value(object obj) nogil: # <<<<<<<<<<<<<< - * """ - * returns the int64 value underlying scalar numpy datetime64 object - */ - - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} - -/* "../../../../../../usr/local/lib/python3.8/dist-packages/numpy/__init__.cython-30.pxd":1041 - * - * - * cdef inline npy_timedelta get_timedelta64_value(object obj) nogil: # <<<<<<<<<<<<<< - * """ - * returns the int64 value underlying scalar numpy timedelta64 object - */ - -static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject *__pyx_v_obj) { - npy_timedelta __pyx_r; - - /* "../../../../../../usr/local/lib/python3.8/dist-packages/numpy/__init__.cython-30.pxd":1045 - * returns the int64 value underlying scalar numpy timedelta64 object - * """ - * return (obj).obval # <<<<<<<<<<<<<< - * - * - */ - __pyx_r = ((PyTimedeltaScalarObject *)__pyx_v_obj)->obval; - goto __pyx_L0; - - /* "../../../../../../usr/local/lib/python3.8/dist-packages/numpy/__init__.cython-30.pxd":1041 - * - * - * cdef inline npy_timedelta get_timedelta64_value(object obj) nogil: # <<<<<<<<<<<<<< - * """ - * returns the int64 value underlying scalar numpy timedelta64 object - */ - - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} - -/* "../../../../../../usr/local/lib/python3.8/dist-packages/numpy/__init__.cython-30.pxd":1048 - * - * - * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) nogil: # <<<<<<<<<<<<<< - * """ - * returns the unit part of the dtype for a numpy datetime64 object. - */ - -static CYTHON_INLINE NPY_DATETIMEUNIT __pyx_f_5numpy_get_datetime64_unit(PyObject *__pyx_v_obj) { - NPY_DATETIMEUNIT __pyx_r; - - /* "../../../../../../usr/local/lib/python3.8/dist-packages/numpy/__init__.cython-30.pxd":1052 - * returns the unit part of the dtype for a numpy datetime64 object. - * """ - * return (obj).obmeta.base # <<<<<<<<<<<<<< - */ - __pyx_r = ((NPY_DATETIMEUNIT)((PyDatetimeScalarObject *)__pyx_v_obj)->obmeta.base); - goto __pyx_L0; - - /* "../../../../../../usr/local/lib/python3.8/dist-packages/numpy/__init__.cython-30.pxd":1048 - * - * - * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) nogil: # <<<<<<<<<<<<<< - * """ - * returns the unit part of the dtype for a numpy datetime64 object. - */ - - /* function exit code */ - __pyx_L0:; - return __pyx_r; -} - -/* "collision_handler.pyx":19 - * - * @cython.wraparound(False) - * cpdef dict closest_dist_query(str sliced_link_name, # <<<<<<<<<<<<<< - * list col_link_names, - * int col_link_name_len, - */ - -static PyObject *__pyx_pw_17collision_handler_1closest_dist_query(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -); /*proto*/ -static PyObject *__pyx_f_17collision_handler_closest_dist_query(PyObject *__pyx_v_sliced_link_name, PyObject *__pyx_v_col_link_names, int __pyx_v_col_link_name_len, PyObject *__pyx_v_col_dict, PyObject *__pyx_v_overlap_dict, CYTHON_UNUSED int __pyx_skip_dispatch) { - int __pyx_v_col_link_idx; - PyArrayObject *__pyx_v_dist = 0; - PyObject *__pyx_v_c_obj_list = 0; - PyObject *__pyx_v_slice_obj_list = 0; - PyObject *__pyx_v_out_dict = 0; - PyObject *__pyx_v_link = 0; - CYTHON_UNUSED PyObject *__pyx_v__ = NULL; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_t_2; - int __pyx_t_3; - int __pyx_t_4; - int __pyx_t_5; - PyObject *__pyx_t_6 = NULL; - int __pyx_t_7; - PyObject *__pyx_t_8 = NULL; - PyObject *__pyx_t_9 = NULL; - int __pyx_t_10; - PyObject *__pyx_t_11 = NULL; - PyObject *(*__pyx_t_12)(PyObject *); - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("closest_dist_query", 1); - - /* "collision_handler.pyx":32 - * # cdef vector[float] dist_list - * # cdef vector[vector[DTYPE_t]] out_list - * cdef dict out_dict = {} # <<<<<<<<<<<<<< - * # cdef float temp - * cdef str link - */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 32, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_out_dict = ((PyObject*)__pyx_t_1); - __pyx_t_1 = 0; - - /* "collision_handler.pyx":39 - * # push_back_main = out_list.push_back - * # push_back = dist_list.push_back - * for col_link_idx in range(col_link_name_len): # <<<<<<<<<<<<<< - * # Only add to output list if within the following criteria - * link = col_link_names[col_link_idx] - */ - __pyx_t_2 = __pyx_v_col_link_name_len; - __pyx_t_3 = __pyx_t_2; - for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { - __pyx_v_col_link_idx = __pyx_t_4; - - /* "collision_handler.pyx":41 - * for col_link_idx in range(col_link_name_len): - * # Only add to output list if within the following criteria - * link = col_link_names[col_link_idx] # <<<<<<<<<<<<<< - * c_obj_list = col_dict[link] - * slice_obj_list = col_dict[sliced_link_name] - */ - if (unlikely(__pyx_v_col_link_names == Py_None)) { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 41, __pyx_L1_error) - } - __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_col_link_names, __pyx_v_col_link_idx, int, 1, __Pyx_PyInt_From_int, 1, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 41, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (!(likely(PyString_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_1))) __PYX_ERR(0, 41, __pyx_L1_error) - __Pyx_XDECREF_SET(__pyx_v_link, ((PyObject*)__pyx_t_1)); - __pyx_t_1 = 0; - - /* "collision_handler.pyx":42 - * # Only add to output list if within the following criteria - * link = col_link_names[col_link_idx] - * c_obj_list = col_dict[link] # <<<<<<<<<<<<<< - * slice_obj_list = col_dict[sliced_link_name] - * if c_obj_list == [] or slice_obj_list == []: - */ - if (unlikely(__pyx_v_col_dict == Py_None)) { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 42, __pyx_L1_error) - } - __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_col_dict, __pyx_v_link); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 42, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (!(likely(PyList_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("list", __pyx_t_1))) __PYX_ERR(0, 42, __pyx_L1_error) - __Pyx_XDECREF_SET(__pyx_v_c_obj_list, ((PyObject*)__pyx_t_1)); - __pyx_t_1 = 0; - - /* "collision_handler.pyx":43 - * link = col_link_names[col_link_idx] - * c_obj_list = col_dict[link] - * slice_obj_list = col_dict[sliced_link_name] # <<<<<<<<<<<<<< - * if c_obj_list == [] or slice_obj_list == []: - * continue - */ - if (unlikely(__pyx_v_col_dict == Py_None)) { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 43, __pyx_L1_error) - } - __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_col_dict, __pyx_v_sliced_link_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 43, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (!(likely(PyList_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("list", __pyx_t_1))) __PYX_ERR(0, 43, __pyx_L1_error) - __Pyx_XDECREF_SET(__pyx_v_slice_obj_list, ((PyObject*)__pyx_t_1)); - __pyx_t_1 = 0; - - /* "collision_handler.pyx":44 - * c_obj_list = col_dict[link] - * slice_obj_list = col_dict[sliced_link_name] - * if c_obj_list == [] or slice_obj_list == []: # <<<<<<<<<<<<<< - * continue - * - */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 44, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = PyObject_RichCompare(__pyx_v_c_obj_list, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 44, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 44, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (!__pyx_t_7) { - } else { - __pyx_t_5 = __pyx_t_7; - goto __pyx_L6_bool_binop_done; - } - __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 44, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_1 = PyObject_RichCompare(__pyx_v_slice_obj_list, __pyx_t_6, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 44, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 44, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_5 = __pyx_t_7; - __pyx_L6_bool_binop_done:; - if (__pyx_t_5) { - - /* "collision_handler.pyx":45 - * slice_obj_list = col_dict[sliced_link_name] - * if c_obj_list == [] or slice_obj_list == []: - * continue # <<<<<<<<<<<<<< - * - * if link in overlap_dict[sliced_link_name]: - */ - goto __pyx_L3_continue; - - /* "collision_handler.pyx":44 - * c_obj_list = col_dict[link] - * slice_obj_list = col_dict[sliced_link_name] - * if c_obj_list == [] or slice_obj_list == []: # <<<<<<<<<<<<<< - * continue - * - */ - } - - /* "collision_handler.pyx":47 - * continue - * - * if link in overlap_dict[sliced_link_name]: # <<<<<<<<<<<<<< - * continue - * - */ - if (unlikely(__pyx_v_overlap_dict == Py_None)) { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 47, __pyx_L1_error) - } - __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_overlap_dict, __pyx_v_sliced_link_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 47, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = (__Pyx_PySequence_ContainsTF(__pyx_v_link, __pyx_t_1, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 47, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__pyx_t_5) { - - /* "collision_handler.pyx":48 - * - * if link in overlap_dict[sliced_link_name]: - * continue # <<<<<<<<<<<<<< - * - * # if col_link_names[col_link_idx] not in overlap_dict[sliced_link_name]: - */ - goto __pyx_L3_continue; - - /* "collision_handler.pyx":47 - * continue - * - * if link in overlap_dict[sliced_link_name]: # <<<<<<<<<<<<<< - * continue - * - */ - } - - /* "collision_handler.pyx":52 - * # if col_link_names[col_link_idx] not in overlap_dict[sliced_link_name]: - * # Calculate the closest point distance between first shape available - * _, _, dist = slice_obj_list[0].closest_point(c_obj_list[0]) # <<<<<<<<<<<<<< - * # out_dict[col_link_names[col_link_idx]] = dist[2] - * # out_list.push_back(dist[2]) - */ - if (unlikely(__pyx_v_slice_obj_list == Py_None)) { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 52, __pyx_L1_error) - } - __pyx_t_6 = __Pyx_GetItemInt_List(__pyx_v_slice_obj_list, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 52, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_closest_point); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 52, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(__pyx_v_c_obj_list == Py_None)) { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 52, __pyx_L1_error) - } - __pyx_t_6 = __Pyx_GetItemInt_List(__pyx_v_c_obj_list, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 52, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_9 = NULL; - __pyx_t_10 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_8))) { - __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8); - if (likely(__pyx_t_9)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); - __Pyx_INCREF(__pyx_t_9); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_8, function); - __pyx_t_10 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_t_6}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10); - __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 52, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - } - if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { - PyObject* sequence = __pyx_t_1; - Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); - if (unlikely(size != 3)) { - if (size > 3) __Pyx_RaiseTooManyValuesError(3); - else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 52, __pyx_L1_error) - } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_8 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); - __pyx_t_9 = PyTuple_GET_ITEM(sequence, 2); - } else { - __pyx_t_8 = PyList_GET_ITEM(sequence, 0); - __pyx_t_6 = PyList_GET_ITEM(sequence, 1); - __pyx_t_9 = PyList_GET_ITEM(sequence, 2); - } - __Pyx_INCREF(__pyx_t_8); - __Pyx_INCREF(__pyx_t_6); - __Pyx_INCREF(__pyx_t_9); - #else - __pyx_t_8 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 52, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 52, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_9 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 52, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - #endif - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - } else { - Py_ssize_t index = -1; - __pyx_t_11 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 52, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_12 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_11); - index = 0; __pyx_t_8 = __pyx_t_12(__pyx_t_11); if (unlikely(!__pyx_t_8)) goto __pyx_L9_unpacking_failed; - __Pyx_GOTREF(__pyx_t_8); - index = 1; __pyx_t_6 = __pyx_t_12(__pyx_t_11); if (unlikely(!__pyx_t_6)) goto __pyx_L9_unpacking_failed; - __Pyx_GOTREF(__pyx_t_6); - index = 2; __pyx_t_9 = __pyx_t_12(__pyx_t_11); if (unlikely(!__pyx_t_9)) goto __pyx_L9_unpacking_failed; - __Pyx_GOTREF(__pyx_t_9); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_11), 3) < 0) __PYX_ERR(0, 52, __pyx_L1_error) - __pyx_t_12 = NULL; - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - goto __pyx_L10_unpacking_done; - __pyx_L9_unpacking_failed:; - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_t_12 = NULL; - if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 52, __pyx_L1_error) - __pyx_L10_unpacking_done:; - } - if (!(likely(((__pyx_t_9) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_9, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 52, __pyx_L1_error) - __Pyx_XDECREF_SET(__pyx_v__, __pyx_t_8); - __pyx_t_8 = 0; - __Pyx_DECREF_SET(__pyx_v__, __pyx_t_6); - __pyx_t_6 = 0; - __Pyx_XDECREF_SET(__pyx_v_dist, ((PyArrayObject *)__pyx_t_9)); - __pyx_t_9 = 0; - - /* "collision_handler.pyx":55 - * # out_dict[col_link_names[col_link_idx]] = dist[2] - * # out_list.push_back(dist[2]) - * out_dict[link] = dist # <<<<<<<<<<<<<< - * - * return out_dict - */ - if (unlikely((PyDict_SetItem(__pyx_v_out_dict, __pyx_v_link, ((PyObject *)__pyx_v_dist)) < 0))) __PYX_ERR(0, 55, __pyx_L1_error) - __pyx_L3_continue:; - } - - /* "collision_handler.pyx":57 - * out_dict[link] = dist - * - * return out_dict # <<<<<<<<<<<<<< - * - * # Ignore negative indice checking (i.e., a[-1]) - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_out_dict); - __pyx_r = __pyx_v_out_dict; - goto __pyx_L0; - - /* "collision_handler.pyx":19 - * - * @cython.wraparound(False) - * cpdef dict closest_dist_query(str sliced_link_name, # <<<<<<<<<<<<<< - * list col_link_names, - * int col_link_name_len, - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_8); - __Pyx_XDECREF(__pyx_t_9); - __Pyx_XDECREF(__pyx_t_11); - __Pyx_AddTraceback("collision_handler.closest_dist_query", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_dist); - __Pyx_XDECREF(__pyx_v_c_obj_list); - __Pyx_XDECREF(__pyx_v_slice_obj_list); - __Pyx_XDECREF(__pyx_v_out_dict); - __Pyx_XDECREF(__pyx_v_link); - __Pyx_XDECREF(__pyx_v__); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static PyObject *__pyx_pw_17collision_handler_1closest_dist_query(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -); /*proto*/ -static PyMethodDef __pyx_mdef_17collision_handler_1closest_dist_query = {"closest_dist_query", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_17collision_handler_1closest_dist_query, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_17collision_handler_1closest_dist_query(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -) { - PyObject *__pyx_v_sliced_link_name = 0; - PyObject *__pyx_v_col_link_names = 0; - int __pyx_v_col_link_name_len; - PyObject *__pyx_v_col_dict = 0; - PyObject *__pyx_v_overlap_dict = 0; - #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED Py_ssize_t __pyx_nargs; - #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - PyObject* values[5] = {0,0,0,0,0}; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("closest_dist_query (wrapper)", 0); - #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS - __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); - #else - __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; - #endif - #endif - __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); - { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_sliced_link_name,&__pyx_n_s_col_link_names,&__pyx_n_s_col_link_name_len,&__pyx_n_s_col_dict,&__pyx_n_s_overlap_dict,0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; - switch (__pyx_nargs) { - case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); - CYTHON_FALLTHROUGH; - case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); - CYTHON_FALLTHROUGH; - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); - CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - CYTHON_FALLTHROUGH; - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sliced_link_name)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 19, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_col_link_names)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 19, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("closest_dist_query", 1, 5, 5, 1); __PYX_ERR(0, 19, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 2: - if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_col_link_name_len)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 19, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("closest_dist_query", 1, 5, 5, 2); __PYX_ERR(0, 19, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 3: - if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_col_dict)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 19, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("closest_dist_query", 1, 5, 5, 3); __PYX_ERR(0, 19, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 4: - if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_overlap_dict)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[4]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 19, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("closest_dist_query", 1, 5, 5, 4); __PYX_ERR(0, 19, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "closest_dist_query") < 0)) __PYX_ERR(0, 19, __pyx_L3_error) - } - } else if (unlikely(__pyx_nargs != 5)) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); - values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); - values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); - } - __pyx_v_sliced_link_name = ((PyObject*)values[0]); - __pyx_v_col_link_names = ((PyObject*)values[1]); - __pyx_v_col_link_name_len = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_col_link_name_len == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 21, __pyx_L3_error) - __pyx_v_col_dict = ((PyObject*)values[3]); - __pyx_v_overlap_dict = ((PyObject*)values[4]); - } - goto __pyx_L6_skip; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("closest_dist_query", 1, 5, 5, __pyx_nargs); __PYX_ERR(0, 19, __pyx_L3_error) - __pyx_L6_skip:; - goto __pyx_L4_argument_unpacking_done; - __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } - } - __Pyx_AddTraceback("collision_handler.closest_dist_query", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sliced_link_name), (&PyString_Type), 1, "sliced_link_name", 1))) __PYX_ERR(0, 19, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_col_link_names), (&PyList_Type), 1, "col_link_names", 1))) __PYX_ERR(0, 20, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_col_dict), (&PyDict_Type), 1, "col_dict", 1))) __PYX_ERR(0, 22, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_overlap_dict), (&PyDict_Type), 1, "overlap_dict", 1))) __PYX_ERR(0, 23, __pyx_L1_error) - __pyx_r = __pyx_pf_17collision_handler_closest_dist_query(__pyx_self, __pyx_v_sliced_link_name, __pyx_v_col_link_names, __pyx_v_col_link_name_len, __pyx_v_col_dict, __pyx_v_overlap_dict); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } - } - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_17collision_handler_closest_dist_query(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_sliced_link_name, PyObject *__pyx_v_col_link_names, int __pyx_v_col_link_name_len, PyObject *__pyx_v_col_dict, PyObject *__pyx_v_overlap_dict) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("closest_dist_query", 1); - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __pyx_f_17collision_handler_closest_dist_query(__pyx_v_sliced_link_name, __pyx_v_col_link_names, __pyx_v_col_link_name_len, __pyx_v_col_dict, __pyx_v_overlap_dict, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 19, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("collision_handler.closest_dist_query", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} +#define __pyx_n_s__7 __pyx_mstate_global->__pyx_n_s__7 +#define __pyx_kp_s_armer_cython_collision_handler_p __pyx_mstate_global->__pyx_kp_s_armer_cython_collision_handler_p +#define __pyx_n_s_asyncio_coroutines __pyx_mstate_global->__pyx_n_s_asyncio_coroutines +#define __pyx_n_s_check_links __pyx_mstate_global->__pyx_n_s_check_links +#define __pyx_n_s_cline_in_traceback __pyx_mstate_global->__pyx_n_s_cline_in_traceback +#define __pyx_n_s_closest_point __pyx_mstate_global->__pyx_n_s_closest_point +#define __pyx_n_s_col_check __pyx_mstate_global->__pyx_n_s_col_check +#define __pyx_n_s_collision __pyx_mstate_global->__pyx_n_s_collision +#define __pyx_n_s_collision_handler __pyx_mstate_global->__pyx_n_s_collision_handler +#define __pyx_n_s_copy __pyx_mstate_global->__pyx_n_s_copy +#define __pyx_n_s_global_check __pyx_mstate_global->__pyx_n_s_global_check +#define __pyx_n_s_global_dict __pyx_mstate_global->__pyx_n_s_global_dict +#define __pyx_n_s_is_coroutine __pyx_mstate_global->__pyx_n_s_is_coroutine +#define __pyx_n_s_len_links __pyx_mstate_global->__pyx_n_s_len_links +#define __pyx_n_s_len_robots __pyx_mstate_global->__pyx_n_s_len_robots +#define __pyx_n_s_main __pyx_mstate_global->__pyx_n_s_main +#define __pyx_n_s_name __pyx_mstate_global->__pyx_n_s_name +#define __pyx_n_s_name_2 __pyx_mstate_global->__pyx_n_s_name_2 +#define __pyx_n_s_overlap_dict __pyx_mstate_global->__pyx_n_s_overlap_dict +#define __pyx_n_s_range __pyx_mstate_global->__pyx_n_s_range +#define __pyx_n_s_robot_links __pyx_mstate_global->__pyx_n_s_robot_links +#define __pyx_n_s_robot_name __pyx_mstate_global->__pyx_n_s_robot_name +#define __pyx_n_s_robot_names __pyx_mstate_global->__pyx_n_s_robot_names +#define __pyx_n_s_sliced_links __pyx_mstate_global->__pyx_n_s_sliced_links +#define __pyx_n_s_test __pyx_mstate_global->__pyx_n_s_test +#define __pyx_n_s_test_2 __pyx_mstate_global->__pyx_n_s_test_2 +#define __pyx_n_s_val1 __pyx_mstate_global->__pyx_n_s_val1 +#define __pyx_n_s_val2 __pyx_mstate_global->__pyx_n_s_val2 +#define __pyx_int_0 __pyx_mstate_global->__pyx_int_0 +#define __pyx_tuple_ __pyx_mstate_global->__pyx_tuple_ +#define __pyx_tuple__3 __pyx_mstate_global->__pyx_tuple__3 +#define __pyx_tuple__5 __pyx_mstate_global->__pyx_tuple__5 +#define __pyx_codeobj__2 __pyx_mstate_global->__pyx_codeobj__2 +#define __pyx_codeobj__4 __pyx_mstate_global->__pyx_codeobj__4 +#define __pyx_codeobj__6 __pyx_mstate_global->__pyx_codeobj__6 +/* #### Code section: module_code ### */ -/* "collision_handler.pyx":61 +/* "collision_handler.pyx":14 * # Ignore negative indice checking (i.e., a[-1]) * @cython.wraparound(False) * cpdef int col_check(list sliced_links, list check_links, int len_links, dict global_dict): # <<<<<<<<<<<<<< @@ -4935,7 +2448,7 @@ static PyObject *__pyx_pf_17collision_handler_closest_dist_query(CYTHON_UNUSED P * cdef int s_idx */ -static PyObject *__pyx_pw_17collision_handler_3col_check(PyObject *__pyx_self, +static PyObject *__pyx_pw_17collision_handler_1col_check(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -4986,7 +2499,7 @@ static int __pyx_f_17collision_handler_col_check(PyObject *__pyx_v_sliced_links, int __pyx_clineno = 0; __Pyx_RefNannySetupContext("col_check", 1); - /* "collision_handler.pyx":72 + /* "collision_handler.pyx":25 * cdef list c_check_list * * for s_idx in range(len_links): # <<<<<<<<<<<<<< @@ -4998,7 +2511,7 @@ static int __pyx_f_17collision_handler_col_check(PyObject *__pyx_v_sliced_links, for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { __pyx_v_s_idx = __pyx_t_3; - /* "collision_handler.pyx":74 + /* "collision_handler.pyx":27 * for s_idx in range(len_links): * # Get the current current slice link's collision objects to check against * col_list = list(sliced_links[s_idx].collision) # <<<<<<<<<<<<<< @@ -5007,30 +2520,30 @@ static int __pyx_f_17collision_handler_col_check(PyObject *__pyx_v_sliced_links, */ if (unlikely(__pyx_v_sliced_links == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 74, __pyx_L1_error) + __PYX_ERR(0, 27, __pyx_L1_error) } - __pyx_t_4 = __Pyx_GetItemInt_List(__pyx_v_sliced_links, __pyx_v_s_idx, int, 1, __Pyx_PyInt_From_int, 1, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 74, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt_List(__pyx_v_sliced_links, __pyx_v_s_idx, int, 1, __Pyx_PyInt_From_int, 1, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_collision); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 74, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_collision); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PySequence_ListKeepNew(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 74, __pyx_L1_error) + __pyx_t_4 = __Pyx_PySequence_ListKeepNew(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF_SET(__pyx_v_col_list, ((PyObject*)__pyx_t_4)); __pyx_t_4 = 0; - /* "collision_handler.pyx":75 + /* "collision_handler.pyx":28 * # Get the current current slice link's collision objects to check against * col_list = list(sliced_links[s_idx].collision) * col_list_len = len(col_list) # <<<<<<<<<<<<<< * * # Get target links as list */ - __pyx_t_6 = __Pyx_PyList_GET_SIZE(__pyx_v_col_list); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 75, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyList_GET_SIZE(__pyx_v_col_list); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 28, __pyx_L1_error) __pyx_v_col_list_len = __pyx_t_6; - /* "collision_handler.pyx":78 + /* "collision_handler.pyx":31 * * # Get target links as list * t_link_names = check_links[s_idx] # <<<<<<<<<<<<<< @@ -5039,15 +2552,15 @@ static int __pyx_f_17collision_handler_col_check(PyObject *__pyx_v_sliced_links, */ if (unlikely(__pyx_v_check_links == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 78, __pyx_L1_error) + __PYX_ERR(0, 31, __pyx_L1_error) } - __pyx_t_4 = __Pyx_GetItemInt_List(__pyx_v_check_links, __pyx_v_s_idx, int, 1, __Pyx_PyInt_From_int, 1, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 78, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt_List(__pyx_v_check_links, __pyx_v_s_idx, int, 1, __Pyx_PyInt_From_int, 1, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 31, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (!(likely(PyList_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None) || __Pyx_RaiseUnexpectedTypeError("list", __pyx_t_4))) __PYX_ERR(0, 78, __pyx_L1_error) + if (!(likely(PyList_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None) || __Pyx_RaiseUnexpectedTypeError("list", __pyx_t_4))) __PYX_ERR(0, 31, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_t_link_names, ((PyObject*)__pyx_t_4)); __pyx_t_4 = 0; - /* "collision_handler.pyx":79 + /* "collision_handler.pyx":32 * # Get target links as list * t_link_names = check_links[s_idx] * eval_link_list_len = len(t_link_names) # <<<<<<<<<<<<<< @@ -5056,12 +2569,12 @@ static int __pyx_f_17collision_handler_col_check(PyObject *__pyx_v_sliced_links, */ if (unlikely(__pyx_v_t_link_names == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(0, 79, __pyx_L1_error) + __PYX_ERR(0, 32, __pyx_L1_error) } - __pyx_t_6 = __Pyx_PyList_GET_SIZE(__pyx_v_t_link_names); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 79, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyList_GET_SIZE(__pyx_v_t_link_names); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 32, __pyx_L1_error) __pyx_v_eval_link_list_len = __pyx_t_6; - /* "collision_handler.pyx":80 + /* "collision_handler.pyx":33 * t_link_names = check_links[s_idx] * eval_link_list_len = len(t_link_names) * for e_idx in range(eval_link_list_len): # <<<<<<<<<<<<<< @@ -5073,7 +2586,7 @@ static int __pyx_f_17collision_handler_col_check(PyObject *__pyx_v_sliced_links, for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) { __pyx_v_e_idx = __pyx_t_9; - /* "collision_handler.pyx":82 + /* "collision_handler.pyx":35 * for e_idx in range(eval_link_list_len): * # Extract the evaluation robot link's collision object list for checking * c_check_list = global_dict[t_link_names[e_idx]] # <<<<<<<<<<<<<< @@ -5082,22 +2595,22 @@ static int __pyx_f_17collision_handler_col_check(PyObject *__pyx_v_sliced_links, */ if (unlikely(__pyx_v_global_dict == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 82, __pyx_L1_error) + __PYX_ERR(0, 35, __pyx_L1_error) } if (unlikely(__pyx_v_t_link_names == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 82, __pyx_L1_error) + __PYX_ERR(0, 35, __pyx_L1_error) } - __pyx_t_4 = __Pyx_GetItemInt_List(__pyx_v_t_link_names, __pyx_v_e_idx, int, 1, __Pyx_PyInt_From_int, 1, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 82, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt_List(__pyx_v_t_link_names, __pyx_v_e_idx, int, 1, __Pyx_PyInt_From_int, 1, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyDict_GetItem(__pyx_v_global_dict, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 82, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyDict_GetItem(__pyx_v_global_dict, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (!(likely(PyList_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None) || __Pyx_RaiseUnexpectedTypeError("list", __pyx_t_5))) __PYX_ERR(0, 82, __pyx_L1_error) + if (!(likely(PyList_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None) || __Pyx_RaiseUnexpectedTypeError("list", __pyx_t_5))) __PYX_ERR(0, 35, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_c_check_list, ((PyObject*)__pyx_t_5)); __pyx_t_5 = 0; - /* "collision_handler.pyx":83 + /* "collision_handler.pyx":36 * # Extract the evaluation robot link's collision object list for checking * c_check_list = global_dict[t_link_names[e_idx]] * chk_list_len = len(c_check_list) # <<<<<<<<<<<<<< @@ -5106,12 +2619,12 @@ static int __pyx_f_17collision_handler_col_check(PyObject *__pyx_v_sliced_links, */ if (unlikely(__pyx_v_c_check_list == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(0, 83, __pyx_L1_error) + __PYX_ERR(0, 36, __pyx_L1_error) } - __pyx_t_6 = __Pyx_PyList_GET_SIZE(__pyx_v_c_check_list); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 83, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyList_GET_SIZE(__pyx_v_c_check_list); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 36, __pyx_L1_error) __pyx_v_chk_list_len = __pyx_t_6; - /* "collision_handler.pyx":85 + /* "collision_handler.pyx":38 * chk_list_len = len(c_check_list) * * for chk_idx in range(chk_list_len): # <<<<<<<<<<<<<< @@ -5123,7 +2636,7 @@ static int __pyx_f_17collision_handler_col_check(PyObject *__pyx_v_sliced_links, for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) { __pyx_v_chk_idx = __pyx_t_12; - /* "collision_handler.pyx":86 + /* "collision_handler.pyx":39 * * for chk_idx in range(chk_list_len): * obj = c_check_list[chk_idx] # <<<<<<<<<<<<<< @@ -5132,14 +2645,14 @@ static int __pyx_f_17collision_handler_col_check(PyObject *__pyx_v_sliced_links, */ if (unlikely(__pyx_v_c_check_list == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 86, __pyx_L1_error) + __PYX_ERR(0, 39, __pyx_L1_error) } - __pyx_t_5 = __Pyx_GetItemInt_List(__pyx_v_c_check_list, __pyx_v_chk_idx, int, 1, __Pyx_PyInt_From_int, 1, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 86, __pyx_L1_error) + __pyx_t_5 = __Pyx_GetItemInt_List(__pyx_v_c_check_list, __pyx_v_chk_idx, int, 1, __Pyx_PyInt_From_int, 1, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_XDECREF_SET(__pyx_v_obj, __pyx_t_5); __pyx_t_5 = 0; - /* "collision_handler.pyx":88 + /* "collision_handler.pyx":41 * obj = c_check_list[chk_idx] * * for col_idx in range(col_list_len): # <<<<<<<<<<<<<< @@ -5151,26 +2664,26 @@ static int __pyx_f_17collision_handler_col_check(PyObject *__pyx_v_sliced_links, for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_14; __pyx_t_15+=1) { __pyx_v_col_idx = __pyx_t_15; - /* "collision_handler.pyx":89 + /* "collision_handler.pyx":42 * * for col_idx in range(col_list_len): * t_obj = col_list[col_idx] # <<<<<<<<<<<<<< * * # Get the distance for comparison */ - __pyx_t_5 = __Pyx_GetItemInt_List(__pyx_v_col_list, __pyx_v_col_idx, int, 1, __Pyx_PyInt_From_int, 1, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 89, __pyx_L1_error) + __pyx_t_5 = __Pyx_GetItemInt_List(__pyx_v_col_list, __pyx_v_col_idx, int, 1, __Pyx_PyInt_From_int, 1, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 42, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_XDECREF_SET(__pyx_v_t_obj, __pyx_t_5); __pyx_t_5 = 0; - /* "collision_handler.pyx":93 + /* "collision_handler.pyx":46 * # Get the distance for comparison * # print(f"obj: {t_obj}") * d, _, _ = t_obj.closest_point(obj) # <<<<<<<<<<<<<< * # print(f"d is: {d}") * if d is not None and d <= 0: */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_t_obj, __pyx_n_s_closest_point); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 93, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_t_obj, __pyx_n_s_closest_point); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_16 = NULL; __pyx_t_17 = 0; @@ -5190,7 +2703,7 @@ static int __pyx_f_17collision_handler_col_check(PyObject *__pyx_v_sliced_links, PyObject *__pyx_callargs[2] = {__pyx_t_16, __pyx_v_obj}; __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_17, 1+__pyx_t_17); __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 93, __pyx_L1_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } @@ -5200,7 +2713,7 @@ static int __pyx_f_17collision_handler_col_check(PyObject *__pyx_v_sliced_links, if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 93, __pyx_L1_error) + __PYX_ERR(0, 46, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -5216,17 +2729,17 @@ static int __pyx_f_17collision_handler_col_check(PyObject *__pyx_v_sliced_links, __Pyx_INCREF(__pyx_t_16); __Pyx_INCREF(__pyx_t_18); #else - __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 93, __pyx_L1_error) + __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_16 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 93, __pyx_L1_error) + __pyx_t_16 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); - __pyx_t_18 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 93, __pyx_L1_error) + __pyx_t_18 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_18); #endif __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { Py_ssize_t index = -1; - __pyx_t_19 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 93, __pyx_L1_error) + __pyx_t_19 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_19); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_20 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_19); @@ -5236,7 +2749,7 @@ static int __pyx_f_17collision_handler_col_check(PyObject *__pyx_v_sliced_links, __Pyx_GOTREF(__pyx_t_16); index = 2; __pyx_t_18 = __pyx_t_20(__pyx_t_19); if (unlikely(!__pyx_t_18)) goto __pyx_L11_unpacking_failed; __Pyx_GOTREF(__pyx_t_18); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_20(__pyx_t_19), 3) < 0) __PYX_ERR(0, 93, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_20(__pyx_t_19), 3) < 0) __PYX_ERR(0, 46, __pyx_L1_error) __pyx_t_20 = NULL; __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; goto __pyx_L12_unpacking_done; @@ -5244,7 +2757,7 @@ static int __pyx_f_17collision_handler_col_check(PyObject *__pyx_v_sliced_links, __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; __pyx_t_20 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 93, __pyx_L1_error) + __PYX_ERR(0, 46, __pyx_L1_error) __pyx_L12_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_d, __pyx_t_4); @@ -5254,7 +2767,7 @@ static int __pyx_f_17collision_handler_col_check(PyObject *__pyx_v_sliced_links, __Pyx_DECREF_SET(__pyx_v__, __pyx_t_18); __pyx_t_18 = 0; - /* "collision_handler.pyx":95 + /* "collision_handler.pyx":48 * d, _, _ = t_obj.closest_point(obj) * # print(f"d is: {d}") * if d is not None and d <= 0: # <<<<<<<<<<<<<< @@ -5267,14 +2780,14 @@ static int __pyx_f_17collision_handler_col_check(PyObject *__pyx_v_sliced_links, __pyx_t_21 = __pyx_t_22; goto __pyx_L14_bool_binop_done; } - __pyx_t_5 = PyObject_RichCompare(__pyx_v_d, __pyx_int_0, Py_LE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 95, __pyx_L1_error) - __pyx_t_22 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_22 < 0))) __PYX_ERR(0, 95, __pyx_L1_error) + __pyx_t_5 = PyObject_RichCompare(__pyx_v_d, __pyx_int_0, Py_LE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 48, __pyx_L1_error) + __pyx_t_22 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_22 < 0))) __PYX_ERR(0, 48, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_21 = __pyx_t_22; __pyx_L14_bool_binop_done:; if (__pyx_t_21) { - /* "collision_handler.pyx":97 + /* "collision_handler.pyx":50 * if d is not None and d <= 0: * # Returns the link idx in collision * return s_idx # <<<<<<<<<<<<<< @@ -5284,7 +2797,7 @@ static int __pyx_f_17collision_handler_col_check(PyObject *__pyx_v_sliced_links, __pyx_r = __pyx_v_s_idx; goto __pyx_L0; - /* "collision_handler.pyx":95 + /* "collision_handler.pyx":48 * d, _, _ = t_obj.closest_point(obj) * # print(f"d is: {d}") * if d is not None and d <= 0: # <<<<<<<<<<<<<< @@ -5297,7 +2810,7 @@ static int __pyx_f_17collision_handler_col_check(PyObject *__pyx_v_sliced_links, } } - /* "collision_handler.pyx":100 + /* "collision_handler.pyx":53 * * # Got here without issue * return -1 # <<<<<<<<<<<<<< @@ -5307,7 +2820,7 @@ static int __pyx_f_17collision_handler_col_check(PyObject *__pyx_v_sliced_links, __pyx_r = -1; goto __pyx_L0; - /* "collision_handler.pyx":61 + /* "collision_handler.pyx":14 * # Ignore negative indice checking (i.e., a[-1]) * @cython.wraparound(False) * cpdef int col_check(list sliced_links, list check_links, int len_links, dict global_dict): # <<<<<<<<<<<<<< @@ -5337,15 +2850,15 @@ static int __pyx_f_17collision_handler_col_check(PyObject *__pyx_v_sliced_links, } /* Python wrapper */ -static PyObject *__pyx_pw_17collision_handler_3col_check(PyObject *__pyx_self, +static PyObject *__pyx_pw_17collision_handler_1col_check(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -static PyMethodDef __pyx_mdef_17collision_handler_3col_check = {"col_check", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_17collision_handler_3col_check, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_17collision_handler_3col_check(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_17collision_handler_1col_check = {"col_check", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_17collision_handler_1col_check, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_17collision_handler_1col_check(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -5398,7 +2911,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 61, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 14, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -5406,9 +2919,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 61, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 14, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("col_check", 1, 4, 4, 1); __PYX_ERR(0, 61, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("col_check", 1, 4, 4, 1); __PYX_ERR(0, 14, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: @@ -5416,9 +2929,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 61, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 14, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("col_check", 1, 4, 4, 2); __PYX_ERR(0, 61, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("col_check", 1, 4, 4, 2); __PYX_ERR(0, 14, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: @@ -5426,14 +2939,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 61, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 14, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("col_check", 1, 4, 4, 3); __PYX_ERR(0, 61, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("col_check", 1, 4, 4, 3); __PYX_ERR(0, 14, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "col_check") < 0)) __PYX_ERR(0, 61, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "col_check") < 0)) __PYX_ERR(0, 14, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 4)) { goto __pyx_L5_argtuple_error; @@ -5445,12 +2958,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } __pyx_v_sliced_links = ((PyObject*)values[0]); __pyx_v_check_links = ((PyObject*)values[1]); - __pyx_v_len_links = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_len_links == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 61, __pyx_L3_error) + __pyx_v_len_links = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_len_links == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 14, __pyx_L3_error) __pyx_v_global_dict = ((PyObject*)values[3]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("col_check", 1, 4, 4, __pyx_nargs); __PYX_ERR(0, 61, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("col_check", 1, 4, 4, __pyx_nargs); __PYX_ERR(0, 14, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -5464,10 +2977,10 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sliced_links), (&PyList_Type), 1, "sliced_links", 1))) __PYX_ERR(0, 61, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_check_links), (&PyList_Type), 1, "check_links", 1))) __PYX_ERR(0, 61, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_global_dict), (&PyDict_Type), 1, "global_dict", 1))) __PYX_ERR(0, 61, __pyx_L1_error) - __pyx_r = __pyx_pf_17collision_handler_2col_check(__pyx_self, __pyx_v_sliced_links, __pyx_v_check_links, __pyx_v_len_links, __pyx_v_global_dict); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sliced_links), (&PyList_Type), 1, "sliced_links", 1))) __PYX_ERR(0, 14, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_check_links), (&PyList_Type), 1, "check_links", 1))) __PYX_ERR(0, 14, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_global_dict), (&PyDict_Type), 1, "global_dict", 1))) __PYX_ERR(0, 14, __pyx_L1_error) + __pyx_r = __pyx_pf_17collision_handler_col_check(__pyx_self, __pyx_v_sliced_links, __pyx_v_check_links, __pyx_v_len_links, __pyx_v_global_dict); /* function exit code */ goto __pyx_L0; @@ -5484,7 +2997,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_17collision_handler_2col_check(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_sliced_links, PyObject *__pyx_v_check_links, int __pyx_v_len_links, PyObject *__pyx_v_global_dict) { +static PyObject *__pyx_pf_17collision_handler_col_check(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_sliced_links, PyObject *__pyx_v_check_links, int __pyx_v_len_links, PyObject *__pyx_v_global_dict) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; @@ -5494,8 +3007,8 @@ static PyObject *__pyx_pf_17collision_handler_2col_check(CYTHON_UNUSED PyObject int __pyx_clineno = 0; __Pyx_RefNannySetupContext("col_check", 1); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __pyx_f_17collision_handler_col_check(__pyx_v_sliced_links, __pyx_v_check_links, __pyx_v_len_links, __pyx_v_global_dict, 0); if (unlikely(__pyx_t_1 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 61, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 61, __pyx_L1_error) + __pyx_t_1 = __pyx_f_17collision_handler_col_check(__pyx_v_sliced_links, __pyx_v_check_links, __pyx_v_len_links, __pyx_v_global_dict, 0); if (unlikely(__pyx_t_1 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 14, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; @@ -5512,7 +3025,7 @@ static PyObject *__pyx_pf_17collision_handler_2col_check(CYTHON_UNUSED PyObject return __pyx_r; } -/* "collision_handler.pyx":104 +/* "collision_handler.pyx":57 * # Ignore negative indice checking (i.e., a[-1]) * @cython.wraparound(False) * cpdef int global_check(str robot_name, # <<<<<<<<<<<<<< @@ -5520,7 +3033,7 @@ static PyObject *__pyx_pf_17collision_handler_2col_check(CYTHON_UNUSED PyObject * int len_robots, */ -static PyObject *__pyx_pw_17collision_handler_5global_check(PyObject *__pyx_self, +static PyObject *__pyx_pw_17collision_handler_3global_check(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -5577,7 +3090,7 @@ static int __pyx_f_17collision_handler_global_check(PyObject *__pyx_v_robot_name int __pyx_clineno = 0; __Pyx_RefNannySetupContext("global_check", 1); - /* "collision_handler.pyx":132 + /* "collision_handler.pyx":85 * # - for the current robot, we want to evaluate one of the sliced links over the current dictionary of links * # - example, panda robot slice link 1 is panda_hand * for r_idx in range(len_robots): # <<<<<<<<<<<<<< @@ -5589,7 +3102,7 @@ static int __pyx_f_17collision_handler_global_check(PyObject *__pyx_v_robot_name for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { __pyx_v_r_idx = __pyx_t_3; - /* "collision_handler.pyx":134 + /* "collision_handler.pyx":87 * for r_idx in range(len_robots): * # Get the robot name for evaluation * r_name = robot_names[r_idx] # <<<<<<<<<<<<<< @@ -5598,15 +3111,15 @@ static int __pyx_f_17collision_handler_global_check(PyObject *__pyx_v_robot_name */ if (unlikely(__pyx_v_robot_names == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 134, __pyx_L1_error) + __PYX_ERR(0, 87, __pyx_L1_error) } - __pyx_t_4 = __Pyx_GetItemInt_List(__pyx_v_robot_names, __pyx_v_r_idx, int, 1, __Pyx_PyInt_From_int, 1, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 134, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt_List(__pyx_v_robot_names, __pyx_v_r_idx, int, 1, __Pyx_PyInt_From_int, 1, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 87, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (!(likely(PyString_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_4))) __PYX_ERR(0, 134, __pyx_L1_error) + if (!(likely(PyString_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_4))) __PYX_ERR(0, 87, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_r_name, ((PyObject*)__pyx_t_4)); __pyx_t_4 = 0; - /* "collision_handler.pyx":139 + /* "collision_handler.pyx":92 * * # Loop though the global dictionary of links for robot in evaluation * for l_name in global_dict[r_name].copy(): # <<<<<<<<<<<<<< @@ -5615,11 +3128,11 @@ static int __pyx_f_17collision_handler_global_check(PyObject *__pyx_v_robot_name */ if (unlikely(__pyx_v_global_dict == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 139, __pyx_L1_error) + __PYX_ERR(0, 92, __pyx_L1_error) } - __pyx_t_5 = __Pyx_PyDict_GetItem(__pyx_v_global_dict, __pyx_v_r_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 139, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyDict_GetItem(__pyx_v_global_dict, __pyx_v_r_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 92, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_copy); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 139, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_copy); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 92, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; @@ -5640,7 +3153,7 @@ static int __pyx_f_17collision_handler_global_check(PyObject *__pyx_v_robot_name PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_7, 0+__pyx_t_7); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 139, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 92, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } @@ -5649,9 +3162,9 @@ static int __pyx_f_17collision_handler_global_check(PyObject *__pyx_v_robot_name __pyx_t_8 = 0; __pyx_t_9 = NULL; } else { - __pyx_t_8 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 139, __pyx_L1_error) + __pyx_t_8 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 92, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 139, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 92, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; for (;;) { @@ -5660,28 +3173,28 @@ static int __pyx_f_17collision_handler_global_check(PyObject *__pyx_v_robot_name { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_6); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 139, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 92, __pyx_L1_error) #endif if (__pyx_t_8 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_8); __Pyx_INCREF(__pyx_t_4); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 139, __pyx_L1_error) + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_8); __Pyx_INCREF(__pyx_t_4); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 92, __pyx_L1_error) #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_6, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 139, __pyx_L1_error) + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_6, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 92, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_6); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 139, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 92, __pyx_L1_error) #endif if (__pyx_t_8 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_8); __Pyx_INCREF(__pyx_t_4); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 139, __pyx_L1_error) + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_8); __Pyx_INCREF(__pyx_t_4); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 92, __pyx_L1_error) #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_6, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 139, __pyx_L1_error) + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_6, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 92, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } @@ -5691,17 +3204,17 @@ static int __pyx_f_17collision_handler_global_check(PyObject *__pyx_v_robot_name PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 139, __pyx_L1_error) + else __PYX_ERR(0, 92, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_4); } - if (!(likely(PyString_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_4))) __PYX_ERR(0, 139, __pyx_L1_error) + if (!(likely(PyString_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_4))) __PYX_ERR(0, 92, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_l_name, ((PyObject*)__pyx_t_4)); __pyx_t_4 = 0; - /* "collision_handler.pyx":144 + /* "collision_handler.pyx":97 * * # Extract the evaluation robot link's collision object list for checking * c_check_list = global_dict[r_name][l_name] # <<<<<<<<<<<<<< @@ -5710,25 +3223,25 @@ static int __pyx_f_17collision_handler_global_check(PyObject *__pyx_v_robot_name */ if (unlikely(__pyx_v_global_dict == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 144, __pyx_L1_error) + __PYX_ERR(0, 97, __pyx_L1_error) } - __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_global_dict, __pyx_v_r_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 144, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_global_dict, __pyx_v_r_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 97, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_Dict_GetItem(__pyx_t_4, __pyx_v_l_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 144, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Dict_GetItem(__pyx_t_4, __pyx_v_l_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 97, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (!(likely(PyList_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None) || __Pyx_RaiseUnexpectedTypeError("list", __pyx_t_5))) __PYX_ERR(0, 144, __pyx_L1_error) + if (!(likely(PyList_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None) || __Pyx_RaiseUnexpectedTypeError("list", __pyx_t_5))) __PYX_ERR(0, 97, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_c_check_list, ((PyObject*)__pyx_t_5)); __pyx_t_5 = 0; - /* "collision_handler.pyx":147 + /* "collision_handler.pyx":100 * * # Handle self checking and populate overlap links for ignoring * if robot_name == r_name and l_name in overlap_dict: # <<<<<<<<<<<<<< * c_ignore_list = overlap_dict[l_name] * else: */ - __pyx_t_11 = (__Pyx_PyString_Equals(__pyx_v_robot_name, __pyx_v_r_name, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 147, __pyx_L1_error) + __pyx_t_11 = (__Pyx_PyString_Equals(__pyx_v_robot_name, __pyx_v_r_name, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 100, __pyx_L1_error) if (__pyx_t_11) { } else { __pyx_t_10 = __pyx_t_11; @@ -5736,14 +3249,14 @@ static int __pyx_f_17collision_handler_global_check(PyObject *__pyx_v_robot_name } if (unlikely(__pyx_v_overlap_dict == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(0, 147, __pyx_L1_error) + __PYX_ERR(0, 100, __pyx_L1_error) } - __pyx_t_11 = (__Pyx_PyDict_ContainsTF(__pyx_v_l_name, __pyx_v_overlap_dict, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 147, __pyx_L1_error) + __pyx_t_11 = (__Pyx_PyDict_ContainsTF(__pyx_v_l_name, __pyx_v_overlap_dict, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 100, __pyx_L1_error) __pyx_t_10 = __pyx_t_11; __pyx_L8_bool_binop_done:; if (__pyx_t_10) { - /* "collision_handler.pyx":148 + /* "collision_handler.pyx":101 * # Handle self checking and populate overlap links for ignoring * if robot_name == r_name and l_name in overlap_dict: * c_ignore_list = overlap_dict[l_name] # <<<<<<<<<<<<<< @@ -5752,15 +3265,15 @@ static int __pyx_f_17collision_handler_global_check(PyObject *__pyx_v_robot_name */ if (unlikely(__pyx_v_overlap_dict == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 148, __pyx_L1_error) + __PYX_ERR(0, 101, __pyx_L1_error) } - __pyx_t_5 = __Pyx_PyDict_GetItem(__pyx_v_overlap_dict, __pyx_v_l_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 148, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyDict_GetItem(__pyx_v_overlap_dict, __pyx_v_l_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 101, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (!(likely(PyList_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None) || __Pyx_RaiseUnexpectedTypeError("list", __pyx_t_5))) __PYX_ERR(0, 148, __pyx_L1_error) + if (!(likely(PyList_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None) || __Pyx_RaiseUnexpectedTypeError("list", __pyx_t_5))) __PYX_ERR(0, 101, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_c_ignore_list, ((PyObject*)__pyx_t_5)); __pyx_t_5 = 0; - /* "collision_handler.pyx":147 + /* "collision_handler.pyx":100 * * # Handle self checking and populate overlap links for ignoring * if robot_name == r_name and l_name in overlap_dict: # <<<<<<<<<<<<<< @@ -5770,7 +3283,7 @@ static int __pyx_f_17collision_handler_global_check(PyObject *__pyx_v_robot_name goto __pyx_L7; } - /* "collision_handler.pyx":150 + /* "collision_handler.pyx":103 * c_ignore_list = overlap_dict[l_name] * else: * c_ignore_list = [] # <<<<<<<<<<<<<< @@ -5778,14 +3291,14 @@ static int __pyx_f_17collision_handler_global_check(PyObject *__pyx_v_robot_name * # Local checking of evaluation robot's link with robot's target links */ /*else*/ { - __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 150, __pyx_L1_error) + __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_XDECREF_SET(__pyx_v_c_ignore_list, ((PyObject*)__pyx_t_5)); __pyx_t_5 = 0; } __pyx_L7:; - /* "collision_handler.pyx":156 + /* "collision_handler.pyx":109 * # speed up achived by limiting this list * # (search space from end-effector down to base_link, sliced as needed) * for l_idx in range(len_links): # <<<<<<<<<<<<<< @@ -5797,7 +3310,7 @@ static int __pyx_f_17collision_handler_global_check(PyObject *__pyx_v_robot_name for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) { __pyx_v_l_idx = __pyx_t_13; - /* "collision_handler.pyx":157 + /* "collision_handler.pyx":110 * # (search space from end-effector down to base_link, sliced as needed) * for l_idx in range(len_links): * link = robot_links[l_idx] # <<<<<<<<<<<<<< @@ -5806,27 +3319,27 @@ static int __pyx_f_17collision_handler_global_check(PyObject *__pyx_v_robot_name */ if (unlikely(__pyx_v_robot_links == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 157, __pyx_L1_error) + __PYX_ERR(0, 110, __pyx_L1_error) } - __pyx_t_5 = __Pyx_GetItemInt_List(__pyx_v_robot_links, __pyx_v_l_idx, int, 1, __Pyx_PyInt_From_int, 1, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 157, __pyx_L1_error) + __pyx_t_5 = __Pyx_GetItemInt_List(__pyx_v_robot_links, __pyx_v_l_idx, int, 1, __Pyx_PyInt_From_int, 1, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 110, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_XDECREF_SET(__pyx_v_link, __pyx_t_5); __pyx_t_5 = 0; - /* "collision_handler.pyx":158 + /* "collision_handler.pyx":111 * for l_idx in range(len_links): * link = robot_links[l_idx] * t_l_name = link.name # <<<<<<<<<<<<<< * # DEBUGGING * # print(f"checking {t_l_name}") */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_link, __pyx_n_s_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 158, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_link, __pyx_n_s_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 111, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (!(likely(PyString_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_5))) __PYX_ERR(0, 158, __pyx_L1_error) + if (!(likely(PyString_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_5))) __PYX_ERR(0, 111, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_t_l_name, ((PyObject*)__pyx_t_5)); __pyx_t_5 = 0; - /* "collision_handler.pyx":163 + /* "collision_handler.pyx":116 * * # TEST (break out if not one of the defined target links) * if l_name not in check_links[l_idx]: # <<<<<<<<<<<<<< @@ -5835,15 +3348,15 @@ static int __pyx_f_17collision_handler_global_check(PyObject *__pyx_v_robot_name */ if (unlikely(__pyx_v_check_links == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 163, __pyx_L1_error) + __PYX_ERR(0, 116, __pyx_L1_error) } - __pyx_t_5 = __Pyx_GetItemInt_List(__pyx_v_check_links, __pyx_v_l_idx, int, 1, __Pyx_PyInt_From_int, 1, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 163, __pyx_L1_error) + __pyx_t_5 = __Pyx_GetItemInt_List(__pyx_v_check_links, __pyx_v_l_idx, int, 1, __Pyx_PyInt_From_int, 1, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 116, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_10 = (__Pyx_PySequence_ContainsTF(__pyx_v_l_name, __pyx_t_5, Py_NE)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 163, __pyx_L1_error) + __pyx_t_10 = (__Pyx_PySequence_ContainsTF(__pyx_v_l_name, __pyx_t_5, Py_NE)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 116, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_10) { - /* "collision_handler.pyx":164 + /* "collision_handler.pyx":117 * # TEST (break out if not one of the defined target links) * if l_name not in check_links[l_idx]: * break # <<<<<<<<<<<<<< @@ -5852,7 +3365,7 @@ static int __pyx_f_17collision_handler_global_check(PyObject *__pyx_v_robot_name */ goto __pyx_L11_break; - /* "collision_handler.pyx":163 + /* "collision_handler.pyx":116 * * # TEST (break out if not one of the defined target links) * if l_name not in check_links[l_idx]: # <<<<<<<<<<<<<< @@ -5861,17 +3374,17 @@ static int __pyx_f_17collision_handler_global_check(PyObject *__pyx_v_robot_name */ } - /* "collision_handler.pyx":167 + /* "collision_handler.pyx":120 * * # Skip to next target link if it is to be ignored * if t_l_name in c_ignore_list: # <<<<<<<<<<<<<< * continue * */ - __pyx_t_10 = (__Pyx_PySequence_ContainsTF(__pyx_v_t_l_name, __pyx_v_c_ignore_list, Py_EQ)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 167, __pyx_L1_error) + __pyx_t_10 = (__Pyx_PySequence_ContainsTF(__pyx_v_t_l_name, __pyx_v_c_ignore_list, Py_EQ)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 120, __pyx_L1_error) if (__pyx_t_10) { - /* "collision_handler.pyx":168 + /* "collision_handler.pyx":121 * # Skip to next target link if it is to be ignored * if t_l_name in c_ignore_list: * continue # <<<<<<<<<<<<<< @@ -5880,7 +3393,7 @@ static int __pyx_f_17collision_handler_global_check(PyObject *__pyx_v_robot_name */ goto __pyx_L10_continue; - /* "collision_handler.pyx":167 + /* "collision_handler.pyx":120 * * # Skip to next target link if it is to be ignored * if t_l_name in c_ignore_list: # <<<<<<<<<<<<<< @@ -5889,17 +3402,17 @@ static int __pyx_f_17collision_handler_global_check(PyObject *__pyx_v_robot_name */ } - /* "collision_handler.pyx":171 + /* "collision_handler.pyx":124 * * # Skip to next target link if it is the same link as current being checked * if t_l_name == l_name: # <<<<<<<<<<<<<< * continue * */ - __pyx_t_10 = (__Pyx_PyString_Equals(__pyx_v_t_l_name, __pyx_v_l_name, Py_EQ)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 171, __pyx_L1_error) + __pyx_t_10 = (__Pyx_PyString_Equals(__pyx_v_t_l_name, __pyx_v_l_name, Py_EQ)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 124, __pyx_L1_error) if (__pyx_t_10) { - /* "collision_handler.pyx":172 + /* "collision_handler.pyx":125 * # Skip to next target link if it is the same link as current being checked * if t_l_name == l_name: * continue # <<<<<<<<<<<<<< @@ -5908,7 +3421,7 @@ static int __pyx_f_17collision_handler_global_check(PyObject *__pyx_v_robot_name */ goto __pyx_L10_continue; - /* "collision_handler.pyx":171 + /* "collision_handler.pyx":124 * * # Skip to next target link if it is the same link as current being checked * if t_l_name == l_name: # <<<<<<<<<<<<<< @@ -5917,7 +3430,7 @@ static int __pyx_f_17collision_handler_global_check(PyObject *__pyx_v_robot_name */ } - /* "collision_handler.pyx":175 + /* "collision_handler.pyx":128 * * # Evaluate current link's collision shapes * chk_list_len = len(c_check_list) # <<<<<<<<<<<<<< @@ -5926,12 +3439,12 @@ static int __pyx_f_17collision_handler_global_check(PyObject *__pyx_v_robot_name */ if (unlikely(__pyx_v_c_check_list == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(0, 175, __pyx_L1_error) + __PYX_ERR(0, 128, __pyx_L1_error) } - __pyx_t_14 = __Pyx_PyList_GET_SIZE(__pyx_v_c_check_list); if (unlikely(__pyx_t_14 == ((Py_ssize_t)-1))) __PYX_ERR(0, 175, __pyx_L1_error) + __pyx_t_14 = __Pyx_PyList_GET_SIZE(__pyx_v_c_check_list); if (unlikely(__pyx_t_14 == ((Py_ssize_t)-1))) __PYX_ERR(0, 128, __pyx_L1_error) __pyx_v_chk_list_len = __pyx_t_14; - /* "collision_handler.pyx":176 + /* "collision_handler.pyx":129 * # Evaluate current link's collision shapes * chk_list_len = len(c_check_list) * for chk_idx in range(chk_list_len): # <<<<<<<<<<<<<< @@ -5943,7 +3456,7 @@ static int __pyx_f_17collision_handler_global_check(PyObject *__pyx_v_robot_name for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) { __pyx_v_chk_idx = __pyx_t_17; - /* "collision_handler.pyx":177 + /* "collision_handler.pyx":130 * chk_list_len = len(c_check_list) * for chk_idx in range(chk_list_len): * obj = c_check_list[chk_idx] # <<<<<<<<<<<<<< @@ -5952,39 +3465,39 @@ static int __pyx_f_17collision_handler_global_check(PyObject *__pyx_v_robot_name */ if (unlikely(__pyx_v_c_check_list == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 177, __pyx_L1_error) + __PYX_ERR(0, 130, __pyx_L1_error) } - __pyx_t_5 = __Pyx_GetItemInt_List(__pyx_v_c_check_list, __pyx_v_chk_idx, int, 1, __Pyx_PyInt_From_int, 1, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 177, __pyx_L1_error) + __pyx_t_5 = __Pyx_GetItemInt_List(__pyx_v_c_check_list, __pyx_v_chk_idx, int, 1, __Pyx_PyInt_From_int, 1, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 130, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_XDECREF_SET(__pyx_v_obj, __pyx_t_5); __pyx_t_5 = 0; - /* "collision_handler.pyx":178 + /* "collision_handler.pyx":131 * for chk_idx in range(chk_list_len): * obj = c_check_list[chk_idx] * col_list = list(link.collision) # <<<<<<<<<<<<<< * col_list_len = len(col_list) * for col_idx in range(col_list_len): */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_link, __pyx_n_s_collision); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 178, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_link, __pyx_n_s_collision); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 131, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = __Pyx_PySequence_ListKeepNew(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 178, __pyx_L1_error) + __pyx_t_4 = __Pyx_PySequence_ListKeepNew(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 131, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF_SET(__pyx_v_col_list, ((PyObject*)__pyx_t_4)); __pyx_t_4 = 0; - /* "collision_handler.pyx":179 + /* "collision_handler.pyx":132 * obj = c_check_list[chk_idx] * col_list = list(link.collision) * col_list_len = len(col_list) # <<<<<<<<<<<<<< * for col_idx in range(col_list_len): * t_obj = col_list[col_idx] */ - __pyx_t_14 = __Pyx_PyList_GET_SIZE(__pyx_v_col_list); if (unlikely(__pyx_t_14 == ((Py_ssize_t)-1))) __PYX_ERR(0, 179, __pyx_L1_error) + __pyx_t_14 = __Pyx_PyList_GET_SIZE(__pyx_v_col_list); if (unlikely(__pyx_t_14 == ((Py_ssize_t)-1))) __PYX_ERR(0, 132, __pyx_L1_error) __pyx_v_col_list_len = __pyx_t_14; - /* "collision_handler.pyx":180 + /* "collision_handler.pyx":133 * col_list = list(link.collision) * col_list_len = len(col_list) * for col_idx in range(col_list_len): # <<<<<<<<<<<<<< @@ -5996,26 +3509,26 @@ static int __pyx_f_17collision_handler_global_check(PyObject *__pyx_v_robot_name for (__pyx_t_20 = 0; __pyx_t_20 < __pyx_t_19; __pyx_t_20+=1) { __pyx_v_col_idx = __pyx_t_20; - /* "collision_handler.pyx":181 + /* "collision_handler.pyx":134 * col_list_len = len(col_list) * for col_idx in range(col_list_len): * t_obj = col_list[col_idx] # <<<<<<<<<<<<<< * * # Get the distance for comparison */ - __pyx_t_4 = __Pyx_GetItemInt_List(__pyx_v_col_list, __pyx_v_col_idx, int, 1, __Pyx_PyInt_From_int, 1, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 181, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt_List(__pyx_v_col_list, __pyx_v_col_idx, int, 1, __Pyx_PyInt_From_int, 1, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 134, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF_SET(__pyx_v_t_obj, __pyx_t_4); __pyx_t_4 = 0; - /* "collision_handler.pyx":185 + /* "collision_handler.pyx":138 * # Get the distance for comparison * # print(f"obj: {t_obj}") * d, _, _ = t_obj.closest_point(obj) # <<<<<<<<<<<<<< * # print(f"d is: {d}") * if d is not None and d <= 0: */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_t_obj, __pyx_n_s_closest_point); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 185, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_t_obj, __pyx_n_s_closest_point); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 138, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_21 = NULL; __pyx_t_22 = 0; @@ -6035,7 +3548,7 @@ static int __pyx_f_17collision_handler_global_check(PyObject *__pyx_v_robot_name PyObject *__pyx_callargs[2] = {__pyx_t_21, __pyx_v_obj}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_22, 1+__pyx_t_22); __Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 185, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 138, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } @@ -6045,7 +3558,7 @@ static int __pyx_f_17collision_handler_global_check(PyObject *__pyx_v_robot_name if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 185, __pyx_L1_error) + __PYX_ERR(0, 138, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -6061,17 +3574,17 @@ static int __pyx_f_17collision_handler_global_check(PyObject *__pyx_v_robot_name __Pyx_INCREF(__pyx_t_21); __Pyx_INCREF(__pyx_t_23); #else - __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 185, __pyx_L1_error) + __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 138, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_21 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 185, __pyx_L1_error) + __pyx_t_21 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 138, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_21); - __pyx_t_23 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 185, __pyx_L1_error) + __pyx_t_23 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 138, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_23); #endif __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { Py_ssize_t index = -1; - __pyx_t_24 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 185, __pyx_L1_error) + __pyx_t_24 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 138, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_24); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_25 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_24); @@ -6081,7 +3594,7 @@ static int __pyx_f_17collision_handler_global_check(PyObject *__pyx_v_robot_name __Pyx_GOTREF(__pyx_t_21); index = 2; __pyx_t_23 = __pyx_t_25(__pyx_t_24); if (unlikely(!__pyx_t_23)) goto __pyx_L19_unpacking_failed; __Pyx_GOTREF(__pyx_t_23); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_25(__pyx_t_24), 3) < 0) __PYX_ERR(0, 185, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_25(__pyx_t_24), 3) < 0) __PYX_ERR(0, 138, __pyx_L1_error) __pyx_t_25 = NULL; __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; goto __pyx_L20_unpacking_done; @@ -6089,7 +3602,7 @@ static int __pyx_f_17collision_handler_global_check(PyObject *__pyx_v_robot_name __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; __pyx_t_25 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 185, __pyx_L1_error) + __PYX_ERR(0, 138, __pyx_L1_error) __pyx_L20_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_d, __pyx_t_5); @@ -6099,7 +3612,7 @@ static int __pyx_f_17collision_handler_global_check(PyObject *__pyx_v_robot_name __Pyx_DECREF_SET(__pyx_v__, __pyx_t_23); __pyx_t_23 = 0; - /* "collision_handler.pyx":187 + /* "collision_handler.pyx":140 * d, _, _ = t_obj.closest_point(obj) * # print(f"d is: {d}") * if d is not None and d <= 0: # <<<<<<<<<<<<<< @@ -6112,14 +3625,14 @@ static int __pyx_f_17collision_handler_global_check(PyObject *__pyx_v_robot_name __pyx_t_10 = __pyx_t_11; goto __pyx_L22_bool_binop_done; } - __pyx_t_4 = PyObject_RichCompare(__pyx_v_d, __pyx_int_0, Py_LE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 187, __pyx_L1_error) - __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 187, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_d, __pyx_int_0, Py_LE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 140, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 140, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_10 = __pyx_t_11; __pyx_L22_bool_binop_done:; if (__pyx_t_10) { - /* "collision_handler.pyx":189 + /* "collision_handler.pyx":142 * if d is not None and d <= 0: * # Returns the link idx in collision * return l_idx # <<<<<<<<<<<<<< @@ -6130,7 +3643,7 @@ static int __pyx_f_17collision_handler_global_check(PyObject *__pyx_v_robot_name __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L0; - /* "collision_handler.pyx":187 + /* "collision_handler.pyx":140 * d, _, _ = t_obj.closest_point(obj) * # print(f"d is: {d}") * if d is not None and d <= 0: # <<<<<<<<<<<<<< @@ -6144,7 +3657,7 @@ static int __pyx_f_17collision_handler_global_check(PyObject *__pyx_v_robot_name } __pyx_L11_break:; - /* "collision_handler.pyx":139 + /* "collision_handler.pyx":92 * * # Loop though the global dictionary of links for robot in evaluation * for l_name in global_dict[r_name].copy(): # <<<<<<<<<<<<<< @@ -6155,7 +3668,7 @@ static int __pyx_f_17collision_handler_global_check(PyObject *__pyx_v_robot_name __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } - /* "collision_handler.pyx":192 + /* "collision_handler.pyx":145 * * # Got here without issue * return -1 # <<<<<<<<<<<<<< @@ -6165,7 +3678,7 @@ static int __pyx_f_17collision_handler_global_check(PyObject *__pyx_v_robot_name __pyx_r = -1; goto __pyx_L0; - /* "collision_handler.pyx":104 + /* "collision_handler.pyx":57 * # Ignore negative indice checking (i.e., a[-1]) * @cython.wraparound(False) * cpdef int global_check(str robot_name, # <<<<<<<<<<<<<< @@ -6200,15 +3713,15 @@ static int __pyx_f_17collision_handler_global_check(PyObject *__pyx_v_robot_name } /* Python wrapper */ -static PyObject *__pyx_pw_17collision_handler_5global_check(PyObject *__pyx_self, +static PyObject *__pyx_pw_17collision_handler_3global_check(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -static PyMethodDef __pyx_mdef_17collision_handler_5global_check = {"global_check", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_17collision_handler_5global_check, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_17collision_handler_5global_check(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_17collision_handler_3global_check = {"global_check", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_17collision_handler_3global_check, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_17collision_handler_3global_check(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -6273,7 +3786,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 104, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 57, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -6281,9 +3794,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 104, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 57, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("global_check", 1, 8, 8, 1); __PYX_ERR(0, 104, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("global_check", 1, 8, 8, 1); __PYX_ERR(0, 57, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: @@ -6291,9 +3804,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 104, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 57, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("global_check", 1, 8, 8, 2); __PYX_ERR(0, 104, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("global_check", 1, 8, 8, 2); __PYX_ERR(0, 57, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: @@ -6301,9 +3814,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 104, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 57, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("global_check", 1, 8, 8, 3); __PYX_ERR(0, 104, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("global_check", 1, 8, 8, 3); __PYX_ERR(0, 57, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: @@ -6311,9 +3824,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[4]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 104, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 57, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("global_check", 1, 8, 8, 4); __PYX_ERR(0, 104, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("global_check", 1, 8, 8, 4); __PYX_ERR(0, 57, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 5: @@ -6321,9 +3834,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[5]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 104, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 57, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("global_check", 1, 8, 8, 5); __PYX_ERR(0, 104, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("global_check", 1, 8, 8, 5); __PYX_ERR(0, 57, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 6: @@ -6331,9 +3844,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[6]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 104, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 57, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("global_check", 1, 8, 8, 6); __PYX_ERR(0, 104, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("global_check", 1, 8, 8, 6); __PYX_ERR(0, 57, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 7: @@ -6341,14 +3854,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[7]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 104, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 57, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("global_check", 1, 8, 8, 7); __PYX_ERR(0, 104, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("global_check", 1, 8, 8, 7); __PYX_ERR(0, 57, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "global_check") < 0)) __PYX_ERR(0, 104, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "global_check") < 0)) __PYX_ERR(0, 57, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 8)) { goto __pyx_L5_argtuple_error; @@ -6364,16 +3877,16 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } __pyx_v_robot_name = ((PyObject*)values[0]); __pyx_v_robot_names = ((PyObject*)values[1]); - __pyx_v_len_robots = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_len_robots == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 106, __pyx_L3_error) + __pyx_v_len_robots = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_len_robots == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 59, __pyx_L3_error) __pyx_v_robot_links = ((PyObject*)values[3]); - __pyx_v_len_links = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_len_links == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 108, __pyx_L3_error) + __pyx_v_len_links = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_len_links == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 61, __pyx_L3_error) __pyx_v_global_dict = ((PyObject*)values[5]); __pyx_v_overlap_dict = ((PyObject*)values[6]); __pyx_v_check_links = ((PyObject*)values[7]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("global_check", 1, 8, 8, __pyx_nargs); __PYX_ERR(0, 104, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("global_check", 1, 8, 8, __pyx_nargs); __PYX_ERR(0, 57, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -6387,13 +3900,13 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_robot_name), (&PyString_Type), 1, "robot_name", 1))) __PYX_ERR(0, 104, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_robot_names), (&PyList_Type), 1, "robot_names", 1))) __PYX_ERR(0, 105, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_robot_links), (&PyList_Type), 1, "robot_links", 1))) __PYX_ERR(0, 107, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_global_dict), (&PyDict_Type), 1, "global_dict", 1))) __PYX_ERR(0, 109, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_overlap_dict), (&PyDict_Type), 1, "overlap_dict", 1))) __PYX_ERR(0, 110, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_check_links), (&PyList_Type), 1, "check_links", 1))) __PYX_ERR(0, 111, __pyx_L1_error) - __pyx_r = __pyx_pf_17collision_handler_4global_check(__pyx_self, __pyx_v_robot_name, __pyx_v_robot_names, __pyx_v_len_robots, __pyx_v_robot_links, __pyx_v_len_links, __pyx_v_global_dict, __pyx_v_overlap_dict, __pyx_v_check_links); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_robot_name), (&PyString_Type), 1, "robot_name", 1))) __PYX_ERR(0, 57, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_robot_names), (&PyList_Type), 1, "robot_names", 1))) __PYX_ERR(0, 58, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_robot_links), (&PyList_Type), 1, "robot_links", 1))) __PYX_ERR(0, 60, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_global_dict), (&PyDict_Type), 1, "global_dict", 1))) __PYX_ERR(0, 62, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_overlap_dict), (&PyDict_Type), 1, "overlap_dict", 1))) __PYX_ERR(0, 63, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_check_links), (&PyList_Type), 1, "check_links", 1))) __PYX_ERR(0, 64, __pyx_L1_error) + __pyx_r = __pyx_pf_17collision_handler_2global_check(__pyx_self, __pyx_v_robot_name, __pyx_v_robot_names, __pyx_v_len_robots, __pyx_v_robot_links, __pyx_v_len_links, __pyx_v_global_dict, __pyx_v_overlap_dict, __pyx_v_check_links); /* function exit code */ goto __pyx_L0; @@ -6410,7 +3923,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_17collision_handler_4global_check(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_robot_name, PyObject *__pyx_v_robot_names, int __pyx_v_len_robots, PyObject *__pyx_v_robot_links, int __pyx_v_len_links, PyObject *__pyx_v_global_dict, PyObject *__pyx_v_overlap_dict, PyObject *__pyx_v_check_links) { +static PyObject *__pyx_pf_17collision_handler_2global_check(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_robot_name, PyObject *__pyx_v_robot_names, int __pyx_v_len_robots, PyObject *__pyx_v_robot_links, int __pyx_v_len_links, PyObject *__pyx_v_global_dict, PyObject *__pyx_v_overlap_dict, PyObject *__pyx_v_check_links) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; @@ -6420,8 +3933,8 @@ static PyObject *__pyx_pf_17collision_handler_4global_check(CYTHON_UNUSED PyObje int __pyx_clineno = 0; __Pyx_RefNannySetupContext("global_check", 1); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __pyx_f_17collision_handler_global_check(__pyx_v_robot_name, __pyx_v_robot_names, __pyx_v_len_robots, __pyx_v_robot_links, __pyx_v_len_links, __pyx_v_global_dict, __pyx_v_overlap_dict, __pyx_v_check_links, 0); if (unlikely(__pyx_t_1 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 104, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 104, __pyx_L1_error) + __pyx_t_1 = __pyx_f_17collision_handler_global_check(__pyx_v_robot_name, __pyx_v_robot_names, __pyx_v_len_robots, __pyx_v_robot_links, __pyx_v_len_links, __pyx_v_global_dict, __pyx_v_overlap_dict, __pyx_v_check_links, 0); if (unlikely(__pyx_t_1 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 57, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 57, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; @@ -6438,14 +3951,14 @@ static PyObject *__pyx_pf_17collision_handler_4global_check(CYTHON_UNUSED PyObje return __pyx_r; } -/* "collision_handler.pyx":194 +/* "collision_handler.pyx":147 * return -1 * * cpdef int test (int val1, int val2): # <<<<<<<<<<<<<< * return val1 + val2 */ -static PyObject *__pyx_pw_17collision_handler_7test(PyObject *__pyx_self, +static PyObject *__pyx_pw_17collision_handler_5test(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -6455,7 +3968,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds static int __pyx_f_17collision_handler_test(int __pyx_v_val1, int __pyx_v_val2, CYTHON_UNUSED int __pyx_skip_dispatch) { int __pyx_r; - /* "collision_handler.pyx":195 + /* "collision_handler.pyx":148 * * cpdef int test (int val1, int val2): * return val1 + val2 # <<<<<<<<<<<<<< @@ -6463,7 +3976,7 @@ static int __pyx_f_17collision_handler_test(int __pyx_v_val1, int __pyx_v_val2, __pyx_r = (__pyx_v_val1 + __pyx_v_val2); goto __pyx_L0; - /* "collision_handler.pyx":194 + /* "collision_handler.pyx":147 * return -1 * * cpdef int test (int val1, int val2): # <<<<<<<<<<<<<< @@ -6476,15 +3989,15 @@ static int __pyx_f_17collision_handler_test(int __pyx_v_val1, int __pyx_v_val2, } /* Python wrapper */ -static PyObject *__pyx_pw_17collision_handler_7test(PyObject *__pyx_self, +static PyObject *__pyx_pw_17collision_handler_5test(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -static PyMethodDef __pyx_mdef_17collision_handler_7test = {"test", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_17collision_handler_7test, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_17collision_handler_7test(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_17collision_handler_5test = {"test", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_17collision_handler_5test, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_17collision_handler_5test(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -6531,7 +4044,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 194, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 147, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -6539,14 +4052,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 194, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 147, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("test", 1, 2, 2, 1); __PYX_ERR(0, 194, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("test", 1, 2, 2, 1); __PYX_ERR(0, 147, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "test") < 0)) __PYX_ERR(0, 194, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "test") < 0)) __PYX_ERR(0, 147, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; @@ -6554,12 +4067,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } - __pyx_v_val1 = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_val1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 194, __pyx_L3_error) - __pyx_v_val2 = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_val2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 194, __pyx_L3_error) + __pyx_v_val1 = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_val1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 147, __pyx_L3_error) + __pyx_v_val2 = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_val2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 147, __pyx_L3_error) } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("test", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 194, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("test", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 147, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -6573,7 +4086,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_17collision_handler_6test(__pyx_self, __pyx_v_val1, __pyx_v_val2); + __pyx_r = __pyx_pf_17collision_handler_4test(__pyx_self, __pyx_v_val1, __pyx_v_val2); /* function exit code */ { @@ -6586,7 +4099,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_17collision_handler_6test(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_val1, int __pyx_v_val2) { +static PyObject *__pyx_pf_17collision_handler_4test(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_val1, int __pyx_v_val2) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; @@ -6596,8 +4109,8 @@ static PyObject *__pyx_pf_17collision_handler_6test(CYTHON_UNUSED PyObject *__py int __pyx_clineno = 0; __Pyx_RefNannySetupContext("test", 1); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __pyx_f_17collision_handler_test(__pyx_v_val1, __pyx_v_val2, 0); if (unlikely(__pyx_t_1 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 194, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 194, __pyx_L1_error) + __pyx_t_1 = __pyx_f_17collision_handler_test(__pyx_v_val1, __pyx_v_val2, 0); if (unlikely(__pyx_t_1 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 147, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 147, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; @@ -6630,46 +4143,30 @@ static PyMethodDef __pyx_methods[] = { static int __Pyx_CreateStringTabAndInitStrings(void) { __Pyx_StringTabEntry __pyx_string_tab[] = { - {&__pyx_n_s_DTYPE, __pyx_k_DTYPE, sizeof(__pyx_k_DTYPE), 0, 0, 1, 1}, - {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1}, - {&__pyx_n_s__12, __pyx_k__12, sizeof(__pyx_k__12), 0, 0, 1, 1}, - {&__pyx_n_s__3, __pyx_k__3, sizeof(__pyx_k__3), 0, 0, 1, 1}, + {&__pyx_n_s__7, __pyx_k__7, sizeof(__pyx_k__7), 0, 0, 1, 1}, {&__pyx_kp_s_armer_cython_collision_handler_p, __pyx_k_armer_cython_collision_handler_p, sizeof(__pyx_k_armer_cython_collision_handler_p), 0, 0, 1, 0}, {&__pyx_n_s_asyncio_coroutines, __pyx_k_asyncio_coroutines, sizeof(__pyx_k_asyncio_coroutines), 0, 0, 1, 1}, {&__pyx_n_s_check_links, __pyx_k_check_links, sizeof(__pyx_k_check_links), 0, 0, 1, 1}, {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, - {&__pyx_n_s_closest_dist_query, __pyx_k_closest_dist_query, sizeof(__pyx_k_closest_dist_query), 0, 0, 1, 1}, {&__pyx_n_s_closest_point, __pyx_k_closest_point, sizeof(__pyx_k_closest_point), 0, 0, 1, 1}, {&__pyx_n_s_col_check, __pyx_k_col_check, sizeof(__pyx_k_col_check), 0, 0, 1, 1}, - {&__pyx_n_s_col_dict, __pyx_k_col_dict, sizeof(__pyx_k_col_dict), 0, 0, 1, 1}, - {&__pyx_n_s_col_link_name_len, __pyx_k_col_link_name_len, sizeof(__pyx_k_col_link_name_len), 0, 0, 1, 1}, - {&__pyx_n_s_col_link_names, __pyx_k_col_link_names, sizeof(__pyx_k_col_link_names), 0, 0, 1, 1}, {&__pyx_n_s_collision, __pyx_k_collision, sizeof(__pyx_k_collision), 0, 0, 1, 1}, {&__pyx_n_s_collision_handler, __pyx_k_collision_handler, sizeof(__pyx_k_collision_handler), 0, 0, 1, 1}, {&__pyx_n_s_copy, __pyx_k_copy, sizeof(__pyx_k_copy), 0, 0, 1, 1}, - {&__pyx_n_s_float64, __pyx_k_float64, sizeof(__pyx_k_float64), 0, 0, 1, 1}, {&__pyx_n_s_global_check, __pyx_k_global_check, sizeof(__pyx_k_global_check), 0, 0, 1, 1}, {&__pyx_n_s_global_dict, __pyx_k_global_dict, sizeof(__pyx_k_global_dict), 0, 0, 1, 1}, - {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, - {&__pyx_n_s_initializing, __pyx_k_initializing, sizeof(__pyx_k_initializing), 0, 0, 1, 1}, {&__pyx_n_s_is_coroutine, __pyx_k_is_coroutine, sizeof(__pyx_k_is_coroutine), 0, 0, 1, 1}, {&__pyx_n_s_len_links, __pyx_k_len_links, sizeof(__pyx_k_len_links), 0, 0, 1, 1}, {&__pyx_n_s_len_robots, __pyx_k_len_robots, sizeof(__pyx_k_len_robots), 0, 0, 1, 1}, {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, {&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1}, - {&__pyx_n_s_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1}, - {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1}, - {&__pyx_kp_s_numpy_core_multiarray_failed_to, __pyx_k_numpy_core_multiarray_failed_to, sizeof(__pyx_k_numpy_core_multiarray_failed_to), 0, 0, 1, 0}, - {&__pyx_kp_s_numpy_core_umath_failed_to_impor, __pyx_k_numpy_core_umath_failed_to_impor, sizeof(__pyx_k_numpy_core_umath_failed_to_impor), 0, 0, 1, 0}, {&__pyx_n_s_overlap_dict, __pyx_k_overlap_dict, sizeof(__pyx_k_overlap_dict), 0, 0, 1, 1}, {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1}, {&__pyx_n_s_robot_links, __pyx_k_robot_links, sizeof(__pyx_k_robot_links), 0, 0, 1, 1}, {&__pyx_n_s_robot_name, __pyx_k_robot_name, sizeof(__pyx_k_robot_name), 0, 0, 1, 1}, {&__pyx_n_s_robot_names, __pyx_k_robot_names, sizeof(__pyx_k_robot_names), 0, 0, 1, 1}, - {&__pyx_n_s_sliced_link_name, __pyx_k_sliced_link_name, sizeof(__pyx_k_sliced_link_name), 0, 0, 1, 1}, {&__pyx_n_s_sliced_links, __pyx_k_sliced_links, sizeof(__pyx_k_sliced_links), 0, 0, 1, 1}, - {&__pyx_n_s_spec, __pyx_k_spec, sizeof(__pyx_k_spec), 0, 0, 1, 1}, {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, {&__pyx_n_s_test_2, __pyx_k_test_2, sizeof(__pyx_k_test_2), 0, 0, 1, 1}, {&__pyx_n_s_val1, __pyx_k_val1, sizeof(__pyx_k_val1), 0, 0, 1, 1}, @@ -6680,8 +4177,7 @@ static int __Pyx_CreateStringTabAndInitStrings(void) { } /* #### Code section: cached_builtins ### */ static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { - __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 39, __pyx_L1_error) - __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(1, 986, __pyx_L1_error) + __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 25, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; @@ -6692,74 +4188,40 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); - /* "../../../../../../usr/local/lib/python3.8/dist-packages/numpy/__init__.cython-30.pxd":986 - * __pyx_import_array() - * except Exception: - * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<< - * - * cdef inline int import_umath() except -1: - */ - __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple_)) __PYX_ERR(1, 986, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple_); - __Pyx_GIVEREF(__pyx_tuple_); - - /* "../../../../../../usr/local/lib/python3.8/dist-packages/numpy/__init__.cython-30.pxd":992 - * _import_umath() - * except Exception: - * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< - * - * cdef inline int import_ufunc() except -1: - */ - __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(1, 992, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__2); - __Pyx_GIVEREF(__pyx_tuple__2); - - /* "collision_handler.pyx":19 - * - * @cython.wraparound(False) - * cpdef dict closest_dist_query(str sliced_link_name, # <<<<<<<<<<<<<< - * list col_link_names, - * int col_link_name_len, - */ - __pyx_tuple__4 = PyTuple_Pack(5, __pyx_n_s_sliced_link_name, __pyx_n_s_col_link_names, __pyx_n_s_col_link_name_len, __pyx_n_s_col_dict, __pyx_n_s_overlap_dict); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 19, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__4); - __Pyx_GIVEREF(__pyx_tuple__4); - __pyx_codeobj__5 = (PyObject*)__Pyx_PyCode_New(5, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__4, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_armer_cython_collision_handler_p, __pyx_n_s_closest_dist_query, 19, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__5)) __PYX_ERR(0, 19, __pyx_L1_error) - - /* "collision_handler.pyx":61 + /* "collision_handler.pyx":14 * # Ignore negative indice checking (i.e., a[-1]) * @cython.wraparound(False) * cpdef int col_check(list sliced_links, list check_links, int len_links, dict global_dict): # <<<<<<<<<<<<<< * * cdef int s_idx */ - __pyx_tuple__6 = PyTuple_Pack(4, __pyx_n_s_sliced_links, __pyx_n_s_check_links, __pyx_n_s_len_links, __pyx_n_s_global_dict); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 61, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__6); - __Pyx_GIVEREF(__pyx_tuple__6); - __pyx_codeobj__7 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__6, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_armer_cython_collision_handler_p, __pyx_n_s_col_check, 61, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__7)) __PYX_ERR(0, 61, __pyx_L1_error) + __pyx_tuple_ = PyTuple_Pack(4, __pyx_n_s_sliced_links, __pyx_n_s_check_links, __pyx_n_s_len_links, __pyx_n_s_global_dict); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 14, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple_); + __Pyx_GIVEREF(__pyx_tuple_); + __pyx_codeobj__2 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple_, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_armer_cython_collision_handler_p, __pyx_n_s_col_check, 14, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2)) __PYX_ERR(0, 14, __pyx_L1_error) - /* "collision_handler.pyx":104 + /* "collision_handler.pyx":57 * # Ignore negative indice checking (i.e., a[-1]) * @cython.wraparound(False) * cpdef int global_check(str robot_name, # <<<<<<<<<<<<<< * list robot_names, * int len_robots, */ - __pyx_tuple__8 = PyTuple_Pack(8, __pyx_n_s_robot_name, __pyx_n_s_robot_names, __pyx_n_s_len_robots, __pyx_n_s_robot_links, __pyx_n_s_len_links, __pyx_n_s_global_dict, __pyx_n_s_overlap_dict, __pyx_n_s_check_links); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 104, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__8); - __Pyx_GIVEREF(__pyx_tuple__8); - __pyx_codeobj__9 = (PyObject*)__Pyx_PyCode_New(8, 0, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__8, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_armer_cython_collision_handler_p, __pyx_n_s_global_check, 104, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__9)) __PYX_ERR(0, 104, __pyx_L1_error) + __pyx_tuple__3 = PyTuple_Pack(8, __pyx_n_s_robot_name, __pyx_n_s_robot_names, __pyx_n_s_len_robots, __pyx_n_s_robot_links, __pyx_n_s_len_links, __pyx_n_s_global_dict, __pyx_n_s_overlap_dict, __pyx_n_s_check_links); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 57, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__3); + __Pyx_GIVEREF(__pyx_tuple__3); + __pyx_codeobj__4 = (PyObject*)__Pyx_PyCode_New(8, 0, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__3, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_armer_cython_collision_handler_p, __pyx_n_s_global_check, 57, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__4)) __PYX_ERR(0, 57, __pyx_L1_error) - /* "collision_handler.pyx":194 + /* "collision_handler.pyx":147 * return -1 * * cpdef int test (int val1, int val2): # <<<<<<<<<<<<<< * return val1 + val2 */ - __pyx_tuple__10 = PyTuple_Pack(2, __pyx_n_s_val1, __pyx_n_s_val2); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 194, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__10); - __Pyx_GIVEREF(__pyx_tuple__10); - __pyx_codeobj__11 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__10, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_armer_cython_collision_handler_p, __pyx_n_s_test, 194, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__11)) __PYX_ERR(0, 194, __pyx_L1_error) + __pyx_tuple__5 = PyTuple_Pack(2, __pyx_n_s_val1, __pyx_n_s_val2); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 147, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__5); + __Pyx_GIVEREF(__pyx_tuple__5); + __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__5, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_armer_cython_collision_handler_p, __pyx_n_s_test, 147, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) __PYX_ERR(0, 147, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; @@ -6824,48 +4286,10 @@ static int __Pyx_modinit_type_init_code(void) { static int __Pyx_modinit_type_import_code(void) { __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); /*--- Type import code ---*/ - __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 9, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_ptype_7cpython_4type_type = __Pyx_ImportType_3_0_5(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type", - #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000 - sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_5(PyTypeObject), - #elif CYTHON_COMPILING_IN_LIMITED_API - sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_5(PyTypeObject), - #else - sizeof(PyHeapTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_5(PyHeapTypeObject), - #endif - __Pyx_ImportType_CheckSize_Warn_3_0_5); if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(2, 9, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyImport_ImportModule("numpy"); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 202, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_ptype_5numpy_dtype = __Pyx_ImportType_3_0_5(__pyx_t_1, "numpy", "dtype", sizeof(PyArray_Descr), __PYX_GET_STRUCT_ALIGNMENT_3_0_5(PyArray_Descr),__Pyx_ImportType_CheckSize_Ignore_3_0_5); if (!__pyx_ptype_5numpy_dtype) __PYX_ERR(1, 202, __pyx_L1_error) - __pyx_ptype_5numpy_flatiter = __Pyx_ImportType_3_0_5(__pyx_t_1, "numpy", "flatiter", sizeof(PyArrayIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_5(PyArrayIterObject),__Pyx_ImportType_CheckSize_Ignore_3_0_5); if (!__pyx_ptype_5numpy_flatiter) __PYX_ERR(1, 225, __pyx_L1_error) - __pyx_ptype_5numpy_broadcast = __Pyx_ImportType_3_0_5(__pyx_t_1, "numpy", "broadcast", sizeof(PyArrayMultiIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_5(PyArrayMultiIterObject),__Pyx_ImportType_CheckSize_Ignore_3_0_5); if (!__pyx_ptype_5numpy_broadcast) __PYX_ERR(1, 229, __pyx_L1_error) - __pyx_ptype_5numpy_ndarray = __Pyx_ImportType_3_0_5(__pyx_t_1, "numpy", "ndarray", sizeof(PyArrayObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_5(PyArrayObject),__Pyx_ImportType_CheckSize_Ignore_3_0_5); if (!__pyx_ptype_5numpy_ndarray) __PYX_ERR(1, 238, __pyx_L1_error) - __pyx_ptype_5numpy_generic = __Pyx_ImportType_3_0_5(__pyx_t_1, "numpy", "generic", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_5(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_5); if (!__pyx_ptype_5numpy_generic) __PYX_ERR(1, 812, __pyx_L1_error) - __pyx_ptype_5numpy_number = __Pyx_ImportType_3_0_5(__pyx_t_1, "numpy", "number", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_5(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_5); if (!__pyx_ptype_5numpy_number) __PYX_ERR(1, 814, __pyx_L1_error) - __pyx_ptype_5numpy_integer = __Pyx_ImportType_3_0_5(__pyx_t_1, "numpy", "integer", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_5(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_5); if (!__pyx_ptype_5numpy_integer) __PYX_ERR(1, 816, __pyx_L1_error) - __pyx_ptype_5numpy_signedinteger = __Pyx_ImportType_3_0_5(__pyx_t_1, "numpy", "signedinteger", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_5(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_5); if (!__pyx_ptype_5numpy_signedinteger) __PYX_ERR(1, 818, __pyx_L1_error) - __pyx_ptype_5numpy_unsignedinteger = __Pyx_ImportType_3_0_5(__pyx_t_1, "numpy", "unsignedinteger", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_5(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_5); if (!__pyx_ptype_5numpy_unsignedinteger) __PYX_ERR(1, 820, __pyx_L1_error) - __pyx_ptype_5numpy_inexact = __Pyx_ImportType_3_0_5(__pyx_t_1, "numpy", "inexact", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_5(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_5); if (!__pyx_ptype_5numpy_inexact) __PYX_ERR(1, 822, __pyx_L1_error) - __pyx_ptype_5numpy_floating = __Pyx_ImportType_3_0_5(__pyx_t_1, "numpy", "floating", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_5(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_5); if (!__pyx_ptype_5numpy_floating) __PYX_ERR(1, 824, __pyx_L1_error) - __pyx_ptype_5numpy_complexfloating = __Pyx_ImportType_3_0_5(__pyx_t_1, "numpy", "complexfloating", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_5(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_5); if (!__pyx_ptype_5numpy_complexfloating) __PYX_ERR(1, 826, __pyx_L1_error) - __pyx_ptype_5numpy_flexible = __Pyx_ImportType_3_0_5(__pyx_t_1, "numpy", "flexible", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_5(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_5); if (!__pyx_ptype_5numpy_flexible) __PYX_ERR(1, 828, __pyx_L1_error) - __pyx_ptype_5numpy_character = __Pyx_ImportType_3_0_5(__pyx_t_1, "numpy", "character", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_5(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_5); if (!__pyx_ptype_5numpy_character) __PYX_ERR(1, 830, __pyx_L1_error) - __pyx_ptype_5numpy_ufunc = __Pyx_ImportType_3_0_5(__pyx_t_1, "numpy", "ufunc", sizeof(PyUFuncObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_5(PyUFuncObject),__Pyx_ImportType_CheckSize_Ignore_3_0_5); if (!__pyx_ptype_5numpy_ufunc) __PYX_ERR(1, 868, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_RefNannyFinishContext(); return 0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_RefNannyFinishContext(); - return -1; } static int __Pyx_modinit_variable_import_code(void) { @@ -7047,8 +4471,6 @@ static CYTHON_SMALL_CODE int __pyx_pymod_exec_collision_handler(PyObject *__pyx_ #endif PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; - int __pyx_t_3; - PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; @@ -7156,7 +4578,7 @@ if (!__Pyx_RefNanny) { (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))) __PYX_ERR(0, 1, __pyx_L1_error) + (void)__Pyx_modinit_type_import_code(); (void)__Pyx_modinit_variable_import_code(); (void)__Pyx_modinit_function_import_code(); /*--- Execution code ---*/ @@ -7164,105 +4586,56 @@ if (!__Pyx_RefNanny) { if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif - /* "collision_handler.pyx":6 - * cimport cython - * - * import numpy as np # <<<<<<<<<<<<<< - * cimport numpy as cnp - * cnp.import_array() - */ - __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_numpy, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_2) < 0) __PYX_ERR(0, 6, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "collision_handler.pyx":8 - * import numpy as np - * cimport numpy as cnp - * cnp.import_array() # <<<<<<<<<<<<<< - * DTYPE = np.float64 - * ctypedef cnp.float64_t DTYPE_t - */ - __pyx_t_3 = __pyx_f_5numpy_import_array(); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 8, __pyx_L1_error) - - /* "collision_handler.pyx":9 - * cimport numpy as cnp - * cnp.import_array() - * DTYPE = np.float64 # <<<<<<<<<<<<<< - * ctypedef cnp.float64_t DTYPE_t - * - */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_float64); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 9, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_DTYPE, __pyx_t_4) < 0) __PYX_ERR(0, 9, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - - /* "collision_handler.pyx":19 - * - * @cython.wraparound(False) - * cpdef dict closest_dist_query(str sliced_link_name, # <<<<<<<<<<<<<< - * list col_link_names, - * int col_link_name_len, - */ - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_17collision_handler_1closest_dist_query, 0, __pyx_n_s_closest_dist_query, NULL, __pyx_n_s_collision_handler, __pyx_d, ((PyObject *)__pyx_codeobj__5)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 19, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_closest_dist_query, __pyx_t_4) < 0) __PYX_ERR(0, 19, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - - /* "collision_handler.pyx":61 + /* "collision_handler.pyx":14 * # Ignore negative indice checking (i.e., a[-1]) * @cython.wraparound(False) * cpdef int col_check(list sliced_links, list check_links, int len_links, dict global_dict): # <<<<<<<<<<<<<< * * cdef int s_idx */ - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_17collision_handler_3col_check, 0, __pyx_n_s_col_check, NULL, __pyx_n_s_collision_handler, __pyx_d, ((PyObject *)__pyx_codeobj__7)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 61, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_col_check, __pyx_t_4) < 0) __PYX_ERR(0, 61, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_17collision_handler_1col_check, 0, __pyx_n_s_col_check, NULL, __pyx_n_s_collision_handler, __pyx_d, ((PyObject *)__pyx_codeobj__2)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 14, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_col_check, __pyx_t_2) < 0) __PYX_ERR(0, 14, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "collision_handler.pyx":104 + /* "collision_handler.pyx":57 * # Ignore negative indice checking (i.e., a[-1]) * @cython.wraparound(False) * cpdef int global_check(str robot_name, # <<<<<<<<<<<<<< * list robot_names, * int len_robots, */ - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_17collision_handler_5global_check, 0, __pyx_n_s_global_check, NULL, __pyx_n_s_collision_handler, __pyx_d, ((PyObject *)__pyx_codeobj__9)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 104, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_global_check, __pyx_t_4) < 0) __PYX_ERR(0, 104, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_17collision_handler_3global_check, 0, __pyx_n_s_global_check, NULL, __pyx_n_s_collision_handler, __pyx_d, ((PyObject *)__pyx_codeobj__4)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 57, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_global_check, __pyx_t_2) < 0) __PYX_ERR(0, 57, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "collision_handler.pyx":194 + /* "collision_handler.pyx":147 * return -1 * * cpdef int test (int val1, int val2): # <<<<<<<<<<<<<< * return val1 + val2 */ - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_17collision_handler_7test, 0, __pyx_n_s_test, NULL, __pyx_n_s_collision_handler, __pyx_d, ((PyObject *)__pyx_codeobj__11)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 194, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_4) < 0) __PYX_ERR(0, 194, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_17collision_handler_5test, 0, __pyx_n_s_test, NULL, __pyx_n_s_collision_handler, __pyx_d, ((PyObject *)__pyx_codeobj__6)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 147, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(0, 147, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "collision_handler.pyx":1 * from libc.math cimport log # <<<<<<<<<<<<<< * from libcpp.list cimport list as cpplist * from libcpp.string cimport string */ - __pyx_t_4 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_test_2, __pyx_t_4) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_test_2, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /*--- Wrapped vars code ---*/ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_4); if (__pyx_m) { if (__pyx_d && stringtab_initialized) { __Pyx_AddTraceback("init collision_handler", __pyx_clineno, __pyx_lineno, __pyx_filename); @@ -7419,434 +4792,71 @@ static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject } #else *type = tstate->curexc_type; - *value = tstate->curexc_value; - *tb = tstate->curexc_traceback; - tstate->curexc_type = 0; - tstate->curexc_value = 0; - tstate->curexc_traceback = 0; -#endif -} -#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 - -/* PyObjectGetAttrStrNoError */ -#if __PYX_LIMITED_VERSION_HEX < 0x030d00A1 -static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) { - __Pyx_PyThreadState_declare - __Pyx_PyThreadState_assign - if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) - __Pyx_PyErr_Clear(); -} -#endif -static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) { - PyObject *result; -#if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 - (void) PyObject_GetOptionalAttr(obj, attr_name, &result); - return result; -#else -#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1 - PyTypeObject* tp = Py_TYPE(obj); - if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) { - return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1); - } -#endif - result = __Pyx_PyObject_GetAttrStr(obj, attr_name); - if (unlikely(!result)) { - __Pyx_PyObject_GetAttrStr_ClearAttributeError(); - } - return result; -#endif -} - -/* GetBuiltinName */ -static PyObject *__Pyx_GetBuiltinName(PyObject *name) { - PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_b, name); - if (unlikely(!result) && !PyErr_Occurred()) { - PyErr_Format(PyExc_NameError, -#if PY_MAJOR_VERSION >= 3 - "name '%U' is not defined", name); -#else - "name '%.200s' is not defined", PyString_AS_STRING(name)); -#endif - } - return result; -} - -/* GetTopmostException */ -#if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE -static _PyErr_StackItem * -__Pyx_PyErr_GetTopmostException(PyThreadState *tstate) -{ - _PyErr_StackItem *exc_info = tstate->exc_info; - while ((exc_info->exc_value == NULL || exc_info->exc_value == Py_None) && - exc_info->previous_item != NULL) - { - exc_info = exc_info->previous_item; - } - return exc_info; -} -#endif - -/* SaveResetException */ -#if CYTHON_FAST_THREAD_STATE -static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { - #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4 - _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate); - PyObject *exc_value = exc_info->exc_value; - if (exc_value == NULL || exc_value == Py_None) { - *value = NULL; - *type = NULL; - *tb = NULL; - } else { - *value = exc_value; - Py_INCREF(*value); - *type = (PyObject*) Py_TYPE(exc_value); - Py_INCREF(*type); - *tb = PyException_GetTraceback(exc_value); - } - #elif CYTHON_USE_EXC_INFO_STACK - _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate); - *type = exc_info->exc_type; - *value = exc_info->exc_value; - *tb = exc_info->exc_traceback; - Py_XINCREF(*type); - Py_XINCREF(*value); - Py_XINCREF(*tb); - #else - *type = tstate->exc_type; - *value = tstate->exc_value; - *tb = tstate->exc_traceback; - Py_XINCREF(*type); - Py_XINCREF(*value); - Py_XINCREF(*tb); - #endif -} -static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { - #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4 - _PyErr_StackItem *exc_info = tstate->exc_info; - PyObject *tmp_value = exc_info->exc_value; - exc_info->exc_value = value; - Py_XDECREF(tmp_value); - Py_XDECREF(type); - Py_XDECREF(tb); - #else - PyObject *tmp_type, *tmp_value, *tmp_tb; - #if CYTHON_USE_EXC_INFO_STACK - _PyErr_StackItem *exc_info = tstate->exc_info; - tmp_type = exc_info->exc_type; - tmp_value = exc_info->exc_value; - tmp_tb = exc_info->exc_traceback; - exc_info->exc_type = type; - exc_info->exc_value = value; - exc_info->exc_traceback = tb; - #else - tmp_type = tstate->exc_type; - tmp_value = tstate->exc_value; - tmp_tb = tstate->exc_traceback; - tstate->exc_type = type; - tstate->exc_value = value; - tstate->exc_traceback = tb; - #endif - Py_XDECREF(tmp_type); - Py_XDECREF(tmp_value); - Py_XDECREF(tmp_tb); - #endif -} -#endif - -/* GetException */ -#if CYTHON_FAST_THREAD_STATE -static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) -#else -static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) -#endif -{ - PyObject *local_type = NULL, *local_value, *local_tb = NULL; -#if CYTHON_FAST_THREAD_STATE - PyObject *tmp_type, *tmp_value, *tmp_tb; - #if PY_VERSION_HEX >= 0x030C00A6 - local_value = tstate->current_exception; - tstate->current_exception = 0; - if (likely(local_value)) { - local_type = (PyObject*) Py_TYPE(local_value); - Py_INCREF(local_type); - local_tb = PyException_GetTraceback(local_value); - } - #else - local_type = tstate->curexc_type; - local_value = tstate->curexc_value; - local_tb = tstate->curexc_traceback; - tstate->curexc_type = 0; - tstate->curexc_value = 0; - tstate->curexc_traceback = 0; - #endif -#else - PyErr_Fetch(&local_type, &local_value, &local_tb); -#endif - PyErr_NormalizeException(&local_type, &local_value, &local_tb); -#if CYTHON_FAST_THREAD_STATE && PY_VERSION_HEX >= 0x030C00A6 - if (unlikely(tstate->current_exception)) -#elif CYTHON_FAST_THREAD_STATE - if (unlikely(tstate->curexc_type)) -#else - if (unlikely(PyErr_Occurred())) -#endif - goto bad; - #if PY_MAJOR_VERSION >= 3 - if (local_tb) { - if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) - goto bad; - } - #endif - Py_XINCREF(local_tb); - Py_XINCREF(local_type); - Py_XINCREF(local_value); - *type = local_type; - *value = local_value; - *tb = local_tb; -#if CYTHON_FAST_THREAD_STATE - #if CYTHON_USE_EXC_INFO_STACK - { - _PyErr_StackItem *exc_info = tstate->exc_info; - #if PY_VERSION_HEX >= 0x030B00a4 - tmp_value = exc_info->exc_value; - exc_info->exc_value = local_value; - tmp_type = NULL; - tmp_tb = NULL; - Py_XDECREF(local_type); - Py_XDECREF(local_tb); - #else - tmp_type = exc_info->exc_type; - tmp_value = exc_info->exc_value; - tmp_tb = exc_info->exc_traceback; - exc_info->exc_type = local_type; - exc_info->exc_value = local_value; - exc_info->exc_traceback = local_tb; - #endif - } - #else - tmp_type = tstate->exc_type; - tmp_value = tstate->exc_value; - tmp_tb = tstate->exc_traceback; - tstate->exc_type = local_type; - tstate->exc_value = local_value; - tstate->exc_traceback = local_tb; - #endif - Py_XDECREF(tmp_type); - Py_XDECREF(tmp_value); - Py_XDECREF(tmp_tb); -#else - PyErr_SetExcInfo(local_type, local_value, local_tb); + *value = tstate->curexc_value; + *tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; #endif - return 0; -bad: - *type = 0; - *value = 0; - *tb = 0; - Py_XDECREF(local_type); - Py_XDECREF(local_value); - Py_XDECREF(local_tb); - return -1; } +#endif -/* PyObjectCall */ -#if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { - PyObject *result; - ternaryfunc call = Py_TYPE(func)->tp_call; - if (unlikely(!call)) - return PyObject_Call(func, arg, kw); - #if PY_MAJOR_VERSION < 3 - if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) - return NULL; - #else - if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) - return NULL; - #endif - result = (*call)(func, arg, kw); - Py_LeaveRecursiveCall(); - if (unlikely(!result) && unlikely(!PyErr_Occurred())) { - PyErr_SetString( - PyExc_SystemError, - "NULL result without error in PyObject_Call"); - } - return result; +/* 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 -/* RaiseException */ -#if PY_MAJOR_VERSION < 3 -static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { +/* PyObjectGetAttrStrNoError */ +#if __PYX_LIMITED_VERSION_HEX < 0x030d00A1 +static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) { __Pyx_PyThreadState_declare - CYTHON_UNUSED_VAR(cause); - Py_XINCREF(type); - if (!value || value == Py_None) - value = NULL; - else - Py_INCREF(value); - if (!tb || tb == Py_None) - tb = NULL; - else { - Py_INCREF(tb); - if (!PyTraceBack_Check(tb)) { - PyErr_SetString(PyExc_TypeError, - "raise: arg 3 must be a traceback or None"); - goto raise_error; - } - } - if (PyType_Check(type)) { -#if CYTHON_COMPILING_IN_PYPY - if (!value) { - Py_INCREF(Py_None); - value = Py_None; - } -#endif - PyErr_NormalizeException(&type, &value, &tb); - } else { - if (value) { - PyErr_SetString(PyExc_TypeError, - "instance exception may not have a separate value"); - goto raise_error; - } - value = type; - type = (PyObject*) Py_TYPE(type); - Py_INCREF(type); - if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { - PyErr_SetString(PyExc_TypeError, - "raise: exception class must be a subclass of BaseException"); - goto raise_error; - } - } __Pyx_PyThreadState_assign - __Pyx_ErrRestore(type, value, tb); - return; -raise_error: - Py_XDECREF(value); - Py_XDECREF(type); - Py_XDECREF(tb); - return; + if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) + __Pyx_PyErr_Clear(); } +#endif +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) { + PyObject *result; +#if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 + (void) PyObject_GetOptionalAttr(obj, attr_name, &result); + return result; #else -static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { - PyObject* owned_instance = NULL; - if (tb == Py_None) { - tb = 0; - } else if (tb && !PyTraceBack_Check(tb)) { - PyErr_SetString(PyExc_TypeError, - "raise: arg 3 must be a traceback or None"); - goto bad; +#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1 + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) { + return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1); } - if (value == Py_None) - value = 0; - if (PyExceptionInstance_Check(type)) { - if (value) { - PyErr_SetString(PyExc_TypeError, - "instance exception may not have a separate value"); - goto bad; - } - value = type; - type = (PyObject*) Py_TYPE(value); - } else if (PyExceptionClass_Check(type)) { - PyObject *instance_class = NULL; - if (value && PyExceptionInstance_Check(value)) { - instance_class = (PyObject*) Py_TYPE(value); - if (instance_class != type) { - int is_subclass = PyObject_IsSubclass(instance_class, type); - if (!is_subclass) { - instance_class = NULL; - } else if (unlikely(is_subclass == -1)) { - goto bad; - } else { - type = instance_class; - } - } - } - if (!instance_class) { - PyObject *args; - if (!value) - args = PyTuple_New(0); - else if (PyTuple_Check(value)) { - Py_INCREF(value); - args = value; - } else - args = PyTuple_Pack(1, value); - if (!args) - goto bad; - owned_instance = PyObject_Call(type, args, NULL); - Py_DECREF(args); - if (!owned_instance) - goto bad; - value = owned_instance; - if (!PyExceptionInstance_Check(value)) { - PyErr_Format(PyExc_TypeError, - "calling %R should have returned an instance of " - "BaseException, not %R", - type, Py_TYPE(value)); - goto bad; - } - } - } else { - PyErr_SetString(PyExc_TypeError, - "raise: exception class must be a subclass of BaseException"); - goto bad; +#endif + result = __Pyx_PyObject_GetAttrStr(obj, attr_name); + if (unlikely(!result)) { + __Pyx_PyObject_GetAttrStr_ClearAttributeError(); } - if (cause) { - PyObject *fixed_cause; - if (cause == Py_None) { - fixed_cause = NULL; - } else if (PyExceptionClass_Check(cause)) { - fixed_cause = PyObject_CallObject(cause, NULL); - if (fixed_cause == NULL) - goto bad; - } else if (PyExceptionInstance_Check(cause)) { - fixed_cause = cause; - Py_INCREF(fixed_cause); - } else { - PyErr_SetString(PyExc_TypeError, - "exception causes must derive from " - "BaseException"); - goto bad; - } - PyException_SetCause(value, fixed_cause); - } - PyErr_SetObject(type, value); - if (tb) { - #if PY_VERSION_HEX >= 0x030C00A6 - PyException_SetTraceback(value, tb); - #elif CYTHON_FAST_THREAD_STATE - PyThreadState *tstate = __Pyx_PyThreadState_Current; - PyObject* tmp_tb = tstate->curexc_traceback; - if (tb != tmp_tb) { - Py_INCREF(tb); - tstate->curexc_traceback = tb; - Py_XDECREF(tmp_tb); - } + return result; +#endif +} + +/* GetBuiltinName */ +static PyObject *__Pyx_GetBuiltinName(PyObject *name) { + PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_b, name); + if (unlikely(!result) && !PyErr_Occurred()) { + PyErr_Format(PyExc_NameError, +#if PY_MAJOR_VERSION >= 3 + "name '%U' is not defined", name); #else - PyObject *tmp_type, *tmp_value, *tmp_tb; - PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); - Py_INCREF(tb); - PyErr_Restore(tmp_type, tmp_value, tb); - Py_XDECREF(tmp_tb); + "name '%.200s' is not defined", PyString_AS_STRING(name)); #endif } -bad: - Py_XDECREF(owned_instance); - return; + return result; } -#endif /* GetItemInt */ static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { @@ -8101,6 +5111,31 @@ static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, } #endif +/* PyObjectCall */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { + PyObject *result; + ternaryfunc call = Py_TYPE(func)->tp_call; + if (unlikely(!call)) + return PyObject_Call(func, arg, kw); + #if PY_MAJOR_VERSION < 3 + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; + #else + if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) + return NULL; + #endif + result = (*call)(func, arg, kw); + Py_LeaveRecursiveCall(); + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + /* PyObjectCallMethO */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { @@ -8241,26 +5276,6 @@ static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { return __Pyx_IterFinish(); } -/* ExtTypeTest */ -static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { - __Pyx_TypeName obj_type_name; - __Pyx_TypeName type_name; - if (unlikely(!type)) { - PyErr_SetString(PyExc_SystemError, "Missing type object"); - return 0; - } - if (likely(__Pyx_TypeCheck(obj, type))) - return 1; - obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); - type_name = __Pyx_PyType_GetName(type); - PyErr_Format(PyExc_TypeError, - "Cannot convert " __Pyx_FMT_TYPENAME " to " __Pyx_FMT_TYPENAME, - obj_type_name, type_name); - __Pyx_DECREF_TypeName(obj_type_name); - __Pyx_DECREF_TypeName(type_name); - return 0; -} - /* TupleAndListFromArray */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE void __Pyx_copy_object_array(PyObject *const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) { @@ -8652,396 +5667,61 @@ static int __Pyx_ParseOptionalKeywords( goto invalid_keyword_type; if (kwds2) { if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; - } else { - goto invalid_keyword; - } - } - Py_XDECREF(key); - Py_XDECREF(value); - return 0; -arg_passed_twice: - __Pyx_RaiseDoubleKeywordsError(function_name, key); - goto bad; -invalid_keyword_type: - PyErr_Format(PyExc_TypeError, - "%.200s() keywords must be strings", function_name); - goto bad; -invalid_keyword: - #if PY_MAJOR_VERSION < 3 - PyErr_Format(PyExc_TypeError, - "%.200s() got an unexpected keyword argument '%.200s'", - function_name, PyString_AsString(key)); - #else - PyErr_Format(PyExc_TypeError, - "%s() got an unexpected keyword argument '%U'", - function_name, key); - #endif -bad: - Py_XDECREF(key); - Py_XDECREF(value); - return -1; -} - -/* ArgTypeTest */ -static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact) -{ - __Pyx_TypeName type_name; - __Pyx_TypeName obj_type_name; - if (unlikely(!type)) { - PyErr_SetString(PyExc_SystemError, "Missing type object"); - return 0; - } - else if (exact) { - #if PY_MAJOR_VERSION == 2 - if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1; - #endif - } - else { - if (likely(__Pyx_TypeCheck(obj, type))) return 1; - } - type_name = __Pyx_PyType_GetName(type); - obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); - PyErr_Format(PyExc_TypeError, - "Argument '%.200s' has incorrect type (expected " __Pyx_FMT_TYPENAME - ", got " __Pyx_FMT_TYPENAME ")", name, type_name, obj_type_name); - __Pyx_DECREF_TypeName(type_name); - __Pyx_DECREF_TypeName(obj_type_name); - return 0; -} - -/* TypeImport */ -#ifndef __PYX_HAVE_RT_ImportType_3_0_5 -#define __PYX_HAVE_RT_ImportType_3_0_5 -static PyTypeObject *__Pyx_ImportType_3_0_5(PyObject *module, const char *module_name, const char *class_name, - size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_5 check_size) -{ - PyObject *result = 0; - char warning[200]; - Py_ssize_t basicsize; - Py_ssize_t itemsize; -#if CYTHON_COMPILING_IN_LIMITED_API - PyObject *py_basicsize; - PyObject *py_itemsize; -#endif - result = PyObject_GetAttrString(module, class_name); - if (!result) - goto bad; - if (!PyType_Check(result)) { - PyErr_Format(PyExc_TypeError, - "%.200s.%.200s is not a type object", - module_name, class_name); - goto bad; - } -#if !CYTHON_COMPILING_IN_LIMITED_API - basicsize = ((PyTypeObject *)result)->tp_basicsize; - itemsize = ((PyTypeObject *)result)->tp_itemsize; -#else - py_basicsize = PyObject_GetAttrString(result, "__basicsize__"); - if (!py_basicsize) - goto bad; - basicsize = PyLong_AsSsize_t(py_basicsize); - Py_DECREF(py_basicsize); - py_basicsize = 0; - if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred()) - goto bad; - py_itemsize = PyObject_GetAttrString(result, "__itemsize__"); - if (!py_itemsize) - goto bad; - itemsize = PyLong_AsSsize_t(py_itemsize); - Py_DECREF(py_itemsize); - py_itemsize = 0; - if (itemsize == (Py_ssize_t)-1 && PyErr_Occurred()) - goto bad; -#endif - if (itemsize) { - if (size % alignment) { - alignment = size % alignment; - } - if (itemsize < (Py_ssize_t)alignment) - itemsize = (Py_ssize_t)alignment; - } - if ((size_t)(basicsize + itemsize) < size) { - PyErr_Format(PyExc_ValueError, - "%.200s.%.200s size changed, may indicate binary incompatibility. " - "Expected %zd from C header, got %zd from PyObject", - module_name, class_name, size, basicsize+itemsize); - goto bad; - } - if (check_size == __Pyx_ImportType_CheckSize_Error_3_0_5 && - ((size_t)basicsize > size || (size_t)(basicsize + itemsize) < size)) { - PyErr_Format(PyExc_ValueError, - "%.200s.%.200s size changed, may indicate binary incompatibility. " - "Expected %zd from C header, got %zd-%zd from PyObject", - module_name, class_name, size, basicsize, basicsize+itemsize); - goto bad; - } - else if (check_size == __Pyx_ImportType_CheckSize_Warn_3_0_5 && (size_t)basicsize > size) { - PyOS_snprintf(warning, sizeof(warning), - "%s.%s size changed, may indicate binary incompatibility. " - "Expected %zd from C header, got %zd from PyObject", - module_name, class_name, size, basicsize); - if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad; - } - return (PyTypeObject *)result; -bad: - Py_XDECREF(result); - return NULL; -} -#endif - -/* Import */ -static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { - PyObject *module = 0; - PyObject *empty_dict = 0; - PyObject *empty_list = 0; - #if PY_MAJOR_VERSION < 3 - PyObject *py_import; - py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); - if (unlikely(!py_import)) - goto bad; - if (!from_list) { - empty_list = PyList_New(0); - if (unlikely(!empty_list)) - goto bad; - from_list = empty_list; - } - #endif - empty_dict = PyDict_New(); - if (unlikely(!empty_dict)) - goto bad; - { - #if PY_MAJOR_VERSION >= 3 - if (level == -1) { - if (strchr(__Pyx_MODULE_NAME, '.') != NULL) { - module = PyImport_ImportModuleLevelObject( - name, __pyx_d, empty_dict, from_list, 1); - if (unlikely(!module)) { - if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError))) - goto bad; - PyErr_Clear(); - } - } - level = 0; - } - #endif - if (!module) { - #if PY_MAJOR_VERSION < 3 - PyObject *py_level = PyInt_FromLong(level); - if (unlikely(!py_level)) - goto bad; - module = PyObject_CallFunctionObjArgs(py_import, - name, __pyx_d, empty_dict, from_list, py_level, (PyObject *)NULL); - Py_DECREF(py_level); - #else - module = PyImport_ImportModuleLevelObject( - name, __pyx_d, empty_dict, from_list, level); - #endif + } else { + goto invalid_keyword; } } -bad: - Py_XDECREF(empty_dict); - Py_XDECREF(empty_list); + Py_XDECREF(key); + Py_XDECREF(value); + return 0; +arg_passed_twice: + __Pyx_RaiseDoubleKeywordsError(function_name, key); + goto bad; +invalid_keyword_type: + PyErr_Format(PyExc_TypeError, + "%.200s() keywords must be strings", function_name); + goto bad; +invalid_keyword: #if PY_MAJOR_VERSION < 3 - Py_XDECREF(py_import); + PyErr_Format(PyExc_TypeError, + "%.200s() got an unexpected keyword argument '%.200s'", + function_name, PyString_AsString(key)); + #else + PyErr_Format(PyExc_TypeError, + "%s() got an unexpected keyword argument '%U'", + function_name, key); #endif - return module; -} - -/* ImportDottedModule */ -#if PY_MAJOR_VERSION >= 3 -static PyObject *__Pyx__ImportDottedModule_Error(PyObject *name, PyObject *parts_tuple, Py_ssize_t count) { - PyObject *partial_name = NULL, *slice = NULL, *sep = NULL; - if (unlikely(PyErr_Occurred())) { - PyErr_Clear(); - } - if (likely(PyTuple_GET_SIZE(parts_tuple) == count)) { - partial_name = name; - } else { - slice = PySequence_GetSlice(parts_tuple, 0, count); - if (unlikely(!slice)) - goto bad; - sep = PyUnicode_FromStringAndSize(".", 1); - if (unlikely(!sep)) - goto bad; - partial_name = PyUnicode_Join(sep, slice); - } - PyErr_Format( -#if PY_MAJOR_VERSION < 3 - PyExc_ImportError, - "No module named '%s'", PyString_AS_STRING(partial_name)); -#else -#if PY_VERSION_HEX >= 0x030600B1 - PyExc_ModuleNotFoundError, -#else - PyExc_ImportError, -#endif - "No module named '%U'", partial_name); -#endif bad: - Py_XDECREF(sep); - Py_XDECREF(slice); - Py_XDECREF(partial_name); - return NULL; -} -#endif -#if PY_MAJOR_VERSION >= 3 -static PyObject *__Pyx__ImportDottedModule_Lookup(PyObject *name) { - PyObject *imported_module; -#if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) - PyObject *modules = PyImport_GetModuleDict(); - if (unlikely(!modules)) - return NULL; - imported_module = __Pyx_PyDict_GetItemStr(modules, name); - Py_XINCREF(imported_module); -#else - imported_module = PyImport_GetModule(name); -#endif - return imported_module; -} -#endif -#if PY_MAJOR_VERSION >= 3 -static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple) { - Py_ssize_t i, nparts; - nparts = PyTuple_GET_SIZE(parts_tuple); - for (i=1; i < nparts && module; i++) { - PyObject *part, *submodule; -#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - part = PyTuple_GET_ITEM(parts_tuple, i); -#else - part = PySequence_ITEM(parts_tuple, i); -#endif - submodule = __Pyx_PyObject_GetAttrStrNoError(module, part); -#if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) - Py_DECREF(part); -#endif - Py_DECREF(module); - module = submodule; - } - if (unlikely(!module)) { - return __Pyx__ImportDottedModule_Error(name, parts_tuple, i); - } - return module; -} -#endif -static PyObject *__Pyx__ImportDottedModule(PyObject *name, PyObject *parts_tuple) { -#if PY_MAJOR_VERSION < 3 - PyObject *module, *from_list, *star = __pyx_n_s__3; - CYTHON_UNUSED_VAR(parts_tuple); - from_list = PyList_New(1); - if (unlikely(!from_list)) - return NULL; - Py_INCREF(star); - PyList_SET_ITEM(from_list, 0, star); - module = __Pyx_Import(name, from_list, 0); - Py_DECREF(from_list); - return module; -#else - PyObject *imported_module; - PyObject *module = __Pyx_Import(name, NULL, 0); - if (!parts_tuple || unlikely(!module)) - return module; - imported_module = __Pyx__ImportDottedModule_Lookup(name); - if (likely(imported_module)) { - Py_DECREF(module); - return imported_module; - } - PyErr_Clear(); - return __Pyx_ImportDottedModule_WalkParts(module, name, parts_tuple); -#endif -} -static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple) { -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030400B1 - PyObject *module = __Pyx__ImportDottedModule_Lookup(name); - if (likely(module)) { - PyObject *spec = __Pyx_PyObject_GetAttrStrNoError(module, __pyx_n_s_spec); - if (likely(spec)) { - PyObject *unsafe = __Pyx_PyObject_GetAttrStrNoError(spec, __pyx_n_s_initializing); - if (likely(!unsafe || !__Pyx_PyObject_IsTrue(unsafe))) { - Py_DECREF(spec); - spec = NULL; - } - Py_XDECREF(unsafe); - } - if (likely(!spec)) { - PyErr_Clear(); - return module; - } - Py_DECREF(spec); - Py_DECREF(module); - } else if (PyErr_Occurred()) { - PyErr_Clear(); - } -#endif - return __Pyx__ImportDottedModule(name, parts_tuple); -} - -/* PyDictVersioning */ -#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS -static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) { - PyObject *dict = Py_TYPE(obj)->tp_dict; - return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0; -} -static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) { - PyObject **dictptr = NULL; - Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset; - if (offset) { -#if CYTHON_COMPILING_IN_CPYTHON - dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj); -#else - dictptr = _PyObject_GetDictPtr(obj); -#endif - } - return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0; -} -static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) { - PyObject *dict = Py_TYPE(obj)->tp_dict; - if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict))) - return 0; - return obj_dict_version == __Pyx_get_object_dict_version(obj); + Py_XDECREF(key); + Py_XDECREF(value); + return -1; } -#endif -/* GetModuleGlobalName */ -#if CYTHON_USE_DICT_VERSIONS -static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) -#else -static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) -#endif +/* ArgTypeTest */ +static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact) { - PyObject *result; -#if !CYTHON_AVOID_BORROWED_REFS -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && PY_VERSION_HEX < 0x030d0000 - result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash); - __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) - if (likely(result)) { - return __Pyx_NewRef(result); - } else if (unlikely(PyErr_Occurred())) { - return NULL; - } -#elif CYTHON_COMPILING_IN_LIMITED_API - if (unlikely(!__pyx_m)) { - return NULL; - } - result = PyObject_GetAttr(__pyx_m, name); - if (likely(result)) { - return result; + __Pyx_TypeName type_name; + __Pyx_TypeName obj_type_name; + if (unlikely(!type)) { + PyErr_SetString(PyExc_SystemError, "Missing type object"); + return 0; } -#else - result = PyDict_GetItem(__pyx_d, name); - __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) - if (likely(result)) { - return __Pyx_NewRef(result); + else if (exact) { + #if PY_MAJOR_VERSION == 2 + if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1; + #endif } -#endif -#else - result = PyObject_GetItem(__pyx_d, name); - __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) - if (likely(result)) { - return __Pyx_NewRef(result); + else { + if (likely(__Pyx_TypeCheck(obj, type))) return 1; } - PyErr_Clear(); -#endif - return __Pyx_GetBuiltinName(name); + type_name = __Pyx_PyType_GetName(type); + obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); + PyErr_Format(PyExc_TypeError, + "Argument '%.200s' has incorrect type (expected " __Pyx_FMT_TYPENAME + ", got " __Pyx_FMT_TYPENAME ")", name, type_name, obj_type_name); + __Pyx_DECREF_TypeName(type_name); + __Pyx_DECREF_TypeName(obj_type_name); + return 0; } /* FixUpExtensionType */ @@ -10294,6 +6974,32 @@ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qual return op; } +/* PyDictVersioning */ +#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) { + PyObject *dict = Py_TYPE(obj)->tp_dict; + return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0; +} +static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) { + PyObject **dictptr = NULL; + Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset; + if (offset) { +#if CYTHON_COMPILING_IN_CPYTHON + dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj); +#else + dictptr = _PyObject_GetDictPtr(obj); +#endif + } + return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0; +} +static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) { + PyObject *dict = Py_TYPE(obj)->tp_dict; + if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict))) + return 0; + return obj_dict_version == __Pyx_get_object_dict_version(obj); +} +#endif + /* CLineInTraceback */ #ifndef CYTHON_CLINE_IN_TRACEBACK static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { @@ -10633,314 +7339,6 @@ static void __Pyx_AddTraceback(const char *funcname, int c_line, return (target_type) value;\ } -/* Declarations */ -#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus) - #ifdef __cplusplus - static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) { - return ::std::complex< float >(x, y); - } - #else - static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) { - return x + y*(__pyx_t_float_complex)_Complex_I; - } - #endif -#else - static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) { - __pyx_t_float_complex z; - z.real = x; - z.imag = y; - return z; - } -#endif - -/* Arithmetic */ -#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus) -#else - static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex a, __pyx_t_float_complex b) { - return (a.real == b.real) && (a.imag == b.imag); - } - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex a, __pyx_t_float_complex b) { - __pyx_t_float_complex z; - z.real = a.real + b.real; - z.imag = a.imag + b.imag; - return z; - } - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex a, __pyx_t_float_complex b) { - __pyx_t_float_complex z; - z.real = a.real - b.real; - z.imag = a.imag - b.imag; - return z; - } - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex a, __pyx_t_float_complex b) { - __pyx_t_float_complex z; - z.real = a.real * b.real - a.imag * b.imag; - z.imag = a.real * b.imag + a.imag * b.real; - return z; - } - #if 1 - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) { - if (b.imag == 0) { - return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real); - } else if (fabsf(b.real) >= fabsf(b.imag)) { - if (b.real == 0 && b.imag == 0) { - return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.imag); - } else { - float r = b.imag / b.real; - float s = (float)(1.0) / (b.real + b.imag * r); - return __pyx_t_float_complex_from_parts( - (a.real + a.imag * r) * s, (a.imag - a.real * r) * s); - } - } else { - float r = b.real / b.imag; - float s = (float)(1.0) / (b.imag + b.real * r); - return __pyx_t_float_complex_from_parts( - (a.real * r + a.imag) * s, (a.imag * r - a.real) * s); - } - } - #else - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) { - if (b.imag == 0) { - return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real); - } else { - float denom = b.real * b.real + b.imag * b.imag; - return __pyx_t_float_complex_from_parts( - (a.real * b.real + a.imag * b.imag) / denom, - (a.imag * b.real - a.real * b.imag) / denom); - } - } - #endif - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex a) { - __pyx_t_float_complex z; - z.real = -a.real; - z.imag = -a.imag; - return z; - } - static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex a) { - return (a.real == 0) && (a.imag == 0); - } - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex a) { - __pyx_t_float_complex z; - z.real = a.real; - z.imag = -a.imag; - return z; - } - #if 1 - static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex z) { - #if !defined(HAVE_HYPOT) || defined(_MSC_VER) - return sqrtf(z.real*z.real + z.imag*z.imag); - #else - return hypotf(z.real, z.imag); - #endif - } - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex a, __pyx_t_float_complex b) { - __pyx_t_float_complex z; - float r, lnr, theta, z_r, z_theta; - if (b.imag == 0 && b.real == (int)b.real) { - if (b.real < 0) { - float denom = a.real * a.real + a.imag * a.imag; - a.real = a.real / denom; - a.imag = -a.imag / denom; - b.real = -b.real; - } - switch ((int)b.real) { - case 0: - z.real = 1; - z.imag = 0; - return z; - case 1: - return a; - case 2: - return __Pyx_c_prod_float(a, a); - case 3: - z = __Pyx_c_prod_float(a, a); - return __Pyx_c_prod_float(z, a); - case 4: - z = __Pyx_c_prod_float(a, a); - return __Pyx_c_prod_float(z, z); - } - } - if (a.imag == 0) { - if (a.real == 0) { - return a; - } else if ((b.imag == 0) && (a.real >= 0)) { - z.real = powf(a.real, b.real); - z.imag = 0; - return z; - } else if (a.real > 0) { - r = a.real; - theta = 0; - } else { - r = -a.real; - theta = atan2f(0.0, -1.0); - } - } else { - r = __Pyx_c_abs_float(a); - theta = atan2f(a.imag, a.real); - } - lnr = logf(r); - z_r = expf(lnr * b.real - theta * b.imag); - z_theta = theta * b.real + lnr * b.imag; - z.real = z_r * cosf(z_theta); - z.imag = z_r * sinf(z_theta); - return z; - } - #endif -#endif - -/* Declarations */ -#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus) - #ifdef __cplusplus - static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) { - return ::std::complex< double >(x, y); - } - #else - static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) { - return x + y*(__pyx_t_double_complex)_Complex_I; - } - #endif -#else - static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) { - __pyx_t_double_complex z; - z.real = x; - z.imag = y; - return z; - } -#endif - -/* Arithmetic */ -#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus) -#else - static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex a, __pyx_t_double_complex b) { - return (a.real == b.real) && (a.imag == b.imag); - } - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex a, __pyx_t_double_complex b) { - __pyx_t_double_complex z; - z.real = a.real + b.real; - z.imag = a.imag + b.imag; - return z; - } - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex a, __pyx_t_double_complex b) { - __pyx_t_double_complex z; - z.real = a.real - b.real; - z.imag = a.imag - b.imag; - return z; - } - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex a, __pyx_t_double_complex b) { - __pyx_t_double_complex z; - z.real = a.real * b.real - a.imag * b.imag; - z.imag = a.real * b.imag + a.imag * b.real; - return z; - } - #if 1 - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) { - if (b.imag == 0) { - return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real); - } else if (fabs(b.real) >= fabs(b.imag)) { - if (b.real == 0 && b.imag == 0) { - return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag); - } else { - double r = b.imag / b.real; - double s = (double)(1.0) / (b.real + b.imag * r); - return __pyx_t_double_complex_from_parts( - (a.real + a.imag * r) * s, (a.imag - a.real * r) * s); - } - } else { - double r = b.real / b.imag; - double s = (double)(1.0) / (b.imag + b.real * r); - return __pyx_t_double_complex_from_parts( - (a.real * r + a.imag) * s, (a.imag * r - a.real) * s); - } - } - #else - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) { - if (b.imag == 0) { - return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real); - } else { - double denom = b.real * b.real + b.imag * b.imag; - return __pyx_t_double_complex_from_parts( - (a.real * b.real + a.imag * b.imag) / denom, - (a.imag * b.real - a.real * b.imag) / denom); - } - } - #endif - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex a) { - __pyx_t_double_complex z; - z.real = -a.real; - z.imag = -a.imag; - return z; - } - static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex a) { - return (a.real == 0) && (a.imag == 0); - } - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex a) { - __pyx_t_double_complex z; - z.real = a.real; - z.imag = -a.imag; - return z; - } - #if 1 - static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex z) { - #if !defined(HAVE_HYPOT) || defined(_MSC_VER) - return sqrt(z.real*z.real + z.imag*z.imag); - #else - return hypot(z.real, z.imag); - #endif - } - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex a, __pyx_t_double_complex b) { - __pyx_t_double_complex z; - double r, lnr, theta, z_r, z_theta; - if (b.imag == 0 && b.real == (int)b.real) { - if (b.real < 0) { - double denom = a.real * a.real + a.imag * a.imag; - a.real = a.real / denom; - a.imag = -a.imag / denom; - b.real = -b.real; - } - switch ((int)b.real) { - case 0: - z.real = 1; - z.imag = 0; - return z; - case 1: - return a; - case 2: - return __Pyx_c_prod_double(a, a); - case 3: - z = __Pyx_c_prod_double(a, a); - return __Pyx_c_prod_double(z, a); - case 4: - z = __Pyx_c_prod_double(a, a); - return __Pyx_c_prod_double(z, z); - } - } - if (a.imag == 0) { - if (a.real == 0) { - return a; - } else if ((b.imag == 0) && (a.real >= 0)) { - z.real = pow(a.real, b.real); - z.imag = 0; - return z; - } else if (a.real > 0) { - r = a.real; - theta = 0; - } else { - r = -a.real; - theta = atan2(0.0, -1.0); - } - } else { - r = __Pyx_c_abs_double(a); - theta = atan2(a.imag, a.real); - } - lnr = log(r); - z_r = exp(lnr * b.real - theta * b.imag); - z_theta = theta * b.real + lnr * b.imag; - z.real = z_r * cos(z_theta); - z.imag = z_r * sin(z_theta); - return z; - } - #endif -#endif - /* CIntFromPy */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC @@ -11278,6 +7676,22 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { } } +/* FormatTypeName */ +#if CYTHON_COMPILING_IN_LIMITED_API +static __Pyx_TypeName +__Pyx_PyType_GetName(PyTypeObject* tp) +{ + PyObject *name = __Pyx_PyObject_GetAttrStr((PyObject *)tp, + __pyx_n_s_name_2); + if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) { + PyErr_Clear(); + Py_XDECREF(name); + name = __Pyx_NewRef(__pyx_n_s__7); + } + return name; +} +#endif + /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC @@ -11342,22 +7756,6 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { } } -/* FormatTypeName */ -#if CYTHON_COMPILING_IN_LIMITED_API -static __Pyx_TypeName -__Pyx_PyType_GetName(PyTypeObject* tp) -{ - PyObject *name = __Pyx_PyObject_GetAttrStr((PyObject *)tp, - __pyx_n_s_name_2); - if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) { - PyErr_Clear(); - Py_XDECREF(name); - name = __Pyx_NewRef(__pyx_n_s__12); - } - return name; -} -#endif - /* CIntFromPy */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC diff --git a/armer/cython/collision_handler.html b/armer/cython/collision_handler.html index f56761c..d5beb2f 100644 --- a/armer/cython/collision_handler.html +++ b/armer/cython/collision_handler.html @@ -305,6 +305,7 @@ .cython .cs { color: #3D7B7B; font-style: italic } /* Comment.Special */ .cython .gd { color: #A00000 } /* Generic.Deleted */ .cython .ge { font-style: italic } /* Generic.Emph */ +.cython .ges { font-weight: bold; font-style: italic } /* Generic.EmphStrong */ .cython .gr { color: #E40000 } /* Generic.Error */ .cython .gh { color: #000080; font-weight: bold } /* Generic.Heading */ .cython .gi { color: #008400 } /* Generic.Inserted */ @@ -370,489 +371,24 @@

Raw output: collision_handler.cpp

+001: from libc.math cimport log
-
  __pyx_t_4 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_4);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test_2, __pyx_t_4) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+
  __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test_2, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
 002: from libcpp.list cimport list as cpplist
 003: from libcpp.string cimport string
 004: cimport cython
 005: 
-
+006: import numpy as np
-
  __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_numpy, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_2) < 0) __PYX_ERR(0, 6, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
 007: cimport numpy as cnp
-
+008: cnp.import_array()
-
  __pyx_t_3 = __pyx_f_5numpy_import_array(); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 8, __pyx_L1_error)
-
+009: DTYPE = np.float64
-
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_float64); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 9, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_4);
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_DTYPE, __pyx_t_4) < 0) __PYX_ERR(0, 9, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-
 010: ctypedef cnp.float64_t DTYPE_t
+
 006: cdef extern from "<vector>" namespace "std":
+
 007:   cdef cppclass vector[T]:
+
 008:     void push_back(T&) nogil
+
 009:     size_t size()
+
 010:     T& operator[](size_t)
 011: 
-
 012: cdef extern from "<vector>" namespace "std":
-
 013:   cdef cppclass vector[T]:
-
 014:     void push_back(T&) nogil
-
 015:     size_t size()
-
 016:     T& operator[](size_t)
-
 017: 
-
 018: @cython.wraparound(False)
-
+019: cpdef dict closest_dist_query(str sliced_link_name,
-
static PyObject *__pyx_pw_17collision_handler_1closest_dist_query(PyObject *__pyx_self, 
-#if CYTHON_METH_FASTCALL
-PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
-#else
-PyObject *__pyx_args, PyObject *__pyx_kwds
-#endif
-); /*proto*/
-static PyObject *__pyx_f_17collision_handler_closest_dist_query(PyObject *__pyx_v_sliced_link_name, PyObject *__pyx_v_col_link_names, int __pyx_v_col_link_name_len, PyObject *__pyx_v_col_dict, PyObject *__pyx_v_overlap_dict, CYTHON_UNUSED int __pyx_skip_dispatch) {
-  int __pyx_v_col_link_idx;
-  PyArrayObject *__pyx_v_dist = 0;
-  PyObject *__pyx_v_c_obj_list = 0;
-  PyObject *__pyx_v_slice_obj_list = 0;
-  PyObject *__pyx_v_out_dict = 0;
-  PyObject *__pyx_v_link = 0;
-  CYTHON_UNUSED PyObject *__pyx_v__ = NULL;
-  PyObject *__pyx_r = NULL;
-/* … */
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_6);
-  __Pyx_XDECREF(__pyx_t_8);
-  __Pyx_XDECREF(__pyx_t_9);
-  __Pyx_XDECREF(__pyx_t_11);
-  __Pyx_AddTraceback("collision_handler.closest_dist_query", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = 0;
-  __pyx_L0:;
-  __Pyx_XDECREF((PyObject *)__pyx_v_dist);
-  __Pyx_XDECREF(__pyx_v_c_obj_list);
-  __Pyx_XDECREF(__pyx_v_slice_obj_list);
-  __Pyx_XDECREF(__pyx_v_out_dict);
-  __Pyx_XDECREF(__pyx_v_link);
-  __Pyx_XDECREF(__pyx_v__);
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* Python wrapper */
-static PyObject *__pyx_pw_17collision_handler_1closest_dist_query(PyObject *__pyx_self, 
-#if CYTHON_METH_FASTCALL
-PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
-#else
-PyObject *__pyx_args, PyObject *__pyx_kwds
-#endif
-); /*proto*/
-static PyMethodDef __pyx_mdef_17collision_handler_1closest_dist_query = {"closest_dist_query", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_17collision_handler_1closest_dist_query, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
-static PyObject *__pyx_pw_17collision_handler_1closest_dist_query(PyObject *__pyx_self, 
-#if CYTHON_METH_FASTCALL
-PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
-#else
-PyObject *__pyx_args, PyObject *__pyx_kwds
-#endif
-) {
-  PyObject *__pyx_v_sliced_link_name = 0;
-  PyObject *__pyx_v_col_link_names = 0;
-  int __pyx_v_col_link_name_len;
-  PyObject *__pyx_v_col_dict = 0;
-  PyObject *__pyx_v_overlap_dict = 0;
-  #if !CYTHON_METH_FASTCALL
-  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
-  #endif
-  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("closest_dist_query (wrapper)", 0);
-  #if !CYTHON_METH_FASTCALL
-  #if CYTHON_ASSUME_SAFE_MACROS
-  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
-  #else
-  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
-  #endif
-  #endif
-  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
-  {
-    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_sliced_link_name,&__pyx_n_s_col_link_names,&__pyx_n_s_col_link_name_len,&__pyx_n_s_col_dict,&__pyx_n_s_overlap_dict,0};
-  PyObject* values[5] = {0,0,0,0,0};
-    if (__pyx_kwds) {
-      Py_ssize_t kw_args;
-      switch (__pyx_nargs) {
-        case  5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
-        CYTHON_FALLTHROUGH;
-        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
-        CYTHON_FALLTHROUGH;
-        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
-        CYTHON_FALLTHROUGH;
-        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
-        CYTHON_FALLTHROUGH;
-        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
-        CYTHON_FALLTHROUGH;
-        case  0: break;
-        default: goto __pyx_L5_argtuple_error;
-      }
-      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
-      switch (__pyx_nargs) {
-        case  0:
-        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sliced_link_name)) != 0)) {
-          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
-          kw_args--;
-        }
-        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 19, __pyx_L3_error)
-        else goto __pyx_L5_argtuple_error;
-        CYTHON_FALLTHROUGH;
-        case  1:
-        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_col_link_names)) != 0)) {
-          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
-          kw_args--;
-        }
-        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 19, __pyx_L3_error)
-        else {
-          __Pyx_RaiseArgtupleInvalid("closest_dist_query", 1, 5, 5, 1); __PYX_ERR(0, 19, __pyx_L3_error)
-        }
-        CYTHON_FALLTHROUGH;
-        case  2:
-        if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_col_link_name_len)) != 0)) {
-          (void)__Pyx_Arg_NewRef_FASTCALL(values[2]);
-          kw_args--;
-        }
-        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 19, __pyx_L3_error)
-        else {
-          __Pyx_RaiseArgtupleInvalid("closest_dist_query", 1, 5, 5, 2); __PYX_ERR(0, 19, __pyx_L3_error)
-        }
-        CYTHON_FALLTHROUGH;
-        case  3:
-        if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_col_dict)) != 0)) {
-          (void)__Pyx_Arg_NewRef_FASTCALL(values[3]);
-          kw_args--;
-        }
-        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 19, __pyx_L3_error)
-        else {
-          __Pyx_RaiseArgtupleInvalid("closest_dist_query", 1, 5, 5, 3); __PYX_ERR(0, 19, __pyx_L3_error)
-        }
-        CYTHON_FALLTHROUGH;
-        case  4:
-        if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_overlap_dict)) != 0)) {
-          (void)__Pyx_Arg_NewRef_FASTCALL(values[4]);
-          kw_args--;
-        }
-        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 19, __pyx_L3_error)
-        else {
-          __Pyx_RaiseArgtupleInvalid("closest_dist_query", 1, 5, 5, 4); __PYX_ERR(0, 19, __pyx_L3_error)
-        }
-      }
-      if (unlikely(kw_args > 0)) {
-        const Py_ssize_t kwd_pos_args = __pyx_nargs;
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "closest_dist_query") < 0)) __PYX_ERR(0, 19, __pyx_L3_error)
-      }
-    } else if (unlikely(__pyx_nargs != 5)) {
-      goto __pyx_L5_argtuple_error;
-    } else {
-      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
-      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
-      values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
-      values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
-      values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
-    }
-    __pyx_v_sliced_link_name = ((PyObject*)values[0]);
-    __pyx_v_col_link_names = ((PyObject*)values[1]);
-    __pyx_v_col_link_name_len = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_col_link_name_len == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 21, __pyx_L3_error)
-    __pyx_v_col_dict = ((PyObject*)values[3]);
-    __pyx_v_overlap_dict = ((PyObject*)values[4]);
-  }
-  goto __pyx_L6_skip;
-  __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("closest_dist_query", 1, 5, 5, __pyx_nargs); __PYX_ERR(0, 19, __pyx_L3_error)
-  __pyx_L6_skip:;
-  goto __pyx_L4_argument_unpacking_done;
-  __pyx_L3_error:;
-  {
-    Py_ssize_t __pyx_temp;
-    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
-      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
-    }
-  }
-  __Pyx_AddTraceback("collision_handler.closest_dist_query", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __Pyx_RefNannyFinishContext();
-  return NULL;
-  __pyx_L4_argument_unpacking_done:;
-  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sliced_link_name), (&PyString_Type), 1, "sliced_link_name", 1))) __PYX_ERR(0, 19, __pyx_L1_error)
-  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_col_link_names), (&PyList_Type), 1, "col_link_names", 1))) __PYX_ERR(0, 20, __pyx_L1_error)
-  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_col_dict), (&PyDict_Type), 1, "col_dict", 1))) __PYX_ERR(0, 22, __pyx_L1_error)
-  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_overlap_dict), (&PyDict_Type), 1, "overlap_dict", 1))) __PYX_ERR(0, 23, __pyx_L1_error)
-  __pyx_r = __pyx_pf_17collision_handler_closest_dist_query(__pyx_self, __pyx_v_sliced_link_name, __pyx_v_col_link_names, __pyx_v_col_link_name_len, __pyx_v_col_dict, __pyx_v_overlap_dict);
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-
-  /* function exit code */
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __pyx_r = NULL;
-  __pyx_L0:;
-  {
-    Py_ssize_t __pyx_temp;
-    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
-      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
-    }
-  }
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_17collision_handler_closest_dist_query(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_sliced_link_name, PyObject *__pyx_v_col_link_names, int __pyx_v_col_link_name_len, PyObject *__pyx_v_col_dict, PyObject *__pyx_v_overlap_dict) {
-  PyObject *__pyx_r = NULL;
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __pyx_f_17collision_handler_closest_dist_query(__pyx_v_sliced_link_name, __pyx_v_col_link_names, __pyx_v_col_link_name_len, __pyx_v_col_dict, __pyx_v_overlap_dict, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 19, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_r = __pyx_t_1;
-  __pyx_t_1 = 0;
-  goto __pyx_L0;
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_AddTraceback("collision_handler.closest_dist_query", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-/* … */
-  __pyx_tuple__4 = PyTuple_Pack(5, __pyx_n_s_sliced_link_name, __pyx_n_s_col_link_names, __pyx_n_s_col_link_name_len, __pyx_n_s_col_dict, __pyx_n_s_overlap_dict); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 19, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__4);
-  __Pyx_GIVEREF(__pyx_tuple__4);
-/* … */
-  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_17collision_handler_1closest_dist_query, 0, __pyx_n_s_closest_dist_query, NULL, __pyx_n_s_collision_handler, __pyx_d, ((PyObject *)__pyx_codeobj__5)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 19, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_4);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_closest_dist_query, __pyx_t_4) < 0) __PYX_ERR(0, 19, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-  __pyx_codeobj__5 = (PyObject*)__Pyx_PyCode_New(5, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__4, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_armer_cython_collision_handler_p, __pyx_n_s_closest_dist_query, 19, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__5)) __PYX_ERR(0, 19, __pyx_L1_error)
-
 020:                               list col_link_names,
-
 021:                               int col_link_name_len,
-
 022:                               dict col_dict,
-
 023:                               dict overlap_dict):
-
 024: 
-
 025:   cdef int col_link_idx
-
 026:   cdef cnp.ndarray dist
-
 027:   cdef list c_obj_list
-
 028:   cdef list slice_obj_list
-
 029:   # cdef list out_list
-
 030:   # cdef vector[float] dist_list
-
 031:   # cdef vector[vector[DTYPE_t]] out_list
-
+032:   cdef dict out_dict = {}
-
  __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 32, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_v_out_dict = ((PyObject*)__pyx_t_1);
-  __pyx_t_1 = 0;
-
 033:   # cdef float temp
-
 034:   cdef str link
-
 035: 
-
 036:   # Method definition
-
 037:   # push_back_main = out_list.push_back
-
 038:   # push_back = dist_list.push_back
-
+039:   for col_link_idx in range(col_link_name_len):
-
  __pyx_t_2 = __pyx_v_col_link_name_len;
-  __pyx_t_3 = __pyx_t_2;
-  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
-    __pyx_v_col_link_idx = __pyx_t_4;
-
 040:     # Only add to output list if within the following criteria
-
+041:     link = col_link_names[col_link_idx]
-
    if (unlikely(__pyx_v_col_link_names == Py_None)) {
-      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
-      __PYX_ERR(0, 41, __pyx_L1_error)
-    }
-    __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_col_link_names, __pyx_v_col_link_idx, int, 1, __Pyx_PyInt_From_int, 1, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 41, __pyx_L1_error)
-    __Pyx_GOTREF(__pyx_t_1);
-    if (!(likely(PyString_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_1))) __PYX_ERR(0, 41, __pyx_L1_error)
-    __Pyx_XDECREF_SET(__pyx_v_link, ((PyObject*)__pyx_t_1));
-    __pyx_t_1 = 0;
-
+042:     c_obj_list = col_dict[link]
-
    if (unlikely(__pyx_v_col_dict == Py_None)) {
-      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
-      __PYX_ERR(0, 42, __pyx_L1_error)
-    }
-    __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_col_dict, __pyx_v_link); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 42, __pyx_L1_error)
-    __Pyx_GOTREF(__pyx_t_1);
-    if (!(likely(PyList_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("list", __pyx_t_1))) __PYX_ERR(0, 42, __pyx_L1_error)
-    __Pyx_XDECREF_SET(__pyx_v_c_obj_list, ((PyObject*)__pyx_t_1));
-    __pyx_t_1 = 0;
-
+043:     slice_obj_list = col_dict[sliced_link_name]
-
    if (unlikely(__pyx_v_col_dict == Py_None)) {
-      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
-      __PYX_ERR(0, 43, __pyx_L1_error)
-    }
-    __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_col_dict, __pyx_v_sliced_link_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 43, __pyx_L1_error)
-    __Pyx_GOTREF(__pyx_t_1);
-    if (!(likely(PyList_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("list", __pyx_t_1))) __PYX_ERR(0, 43, __pyx_L1_error)
-    __Pyx_XDECREF_SET(__pyx_v_slice_obj_list, ((PyObject*)__pyx_t_1));
-    __pyx_t_1 = 0;
-
+044:     if c_obj_list == [] or slice_obj_list == []:
-
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 44, __pyx_L1_error)
-    __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_6 = PyObject_RichCompare(__pyx_v_c_obj_list, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 44, __pyx_L1_error)
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 44, __pyx_L1_error)
-    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-    if (!__pyx_t_7) {
-    } else {
-      __pyx_t_5 = __pyx_t_7;
-      goto __pyx_L6_bool_binop_done;
-    }
-    __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 44, __pyx_L1_error)
-    __Pyx_GOTREF(__pyx_t_6);
-    __pyx_t_1 = PyObject_RichCompare(__pyx_v_slice_obj_list, __pyx_t_6, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 44, __pyx_L1_error)
-    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 44, __pyx_L1_error)
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __pyx_t_5 = __pyx_t_7;
-    __pyx_L6_bool_binop_done:;
-    if (__pyx_t_5) {
-/* … */
-    }
-
+045:       continue
-
      goto __pyx_L3_continue;
-
 046: 
-
+047:     if link in overlap_dict[sliced_link_name]:
-
    if (unlikely(__pyx_v_overlap_dict == Py_None)) {
-      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
-      __PYX_ERR(0, 47, __pyx_L1_error)
-    }
-    __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_overlap_dict, __pyx_v_sliced_link_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 47, __pyx_L1_error)
-    __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_5 = (__Pyx_PySequence_ContainsTF(__pyx_v_link, __pyx_t_1, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 47, __pyx_L1_error)
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    if (__pyx_t_5) {
-/* … */
-    }
-
+048:       continue
-
      goto __pyx_L3_continue;
-
 049: 
-
 050:     # if col_link_names[col_link_idx] not in overlap_dict[sliced_link_name]:
-
 051:       # Calculate the closest point distance between first shape available
-
+052:     _, _, dist = slice_obj_list[0].closest_point(c_obj_list[0])
-
    if (unlikely(__pyx_v_slice_obj_list == Py_None)) {
-      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
-      __PYX_ERR(0, 52, __pyx_L1_error)
-    }
-    __pyx_t_6 = __Pyx_GetItemInt_List(__pyx_v_slice_obj_list, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 52, __pyx_L1_error)
-    __Pyx_GOTREF(__pyx_t_6);
-    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_closest_point); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 52, __pyx_L1_error)
-    __Pyx_GOTREF(__pyx_t_8);
-    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-    if (unlikely(__pyx_v_c_obj_list == Py_None)) {
-      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
-      __PYX_ERR(0, 52, __pyx_L1_error)
-    }
-    __pyx_t_6 = __Pyx_GetItemInt_List(__pyx_v_c_obj_list, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 52, __pyx_L1_error)
-    __Pyx_GOTREF(__pyx_t_6);
-    __pyx_t_9 = NULL;
-    __pyx_t_10 = 0;
-    #if CYTHON_UNPACK_METHODS
-    if (likely(PyMethod_Check(__pyx_t_8))) {
-      __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8);
-      if (likely(__pyx_t_9)) {
-        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
-        __Pyx_INCREF(__pyx_t_9);
-        __Pyx_INCREF(function);
-        __Pyx_DECREF_SET(__pyx_t_8, function);
-        __pyx_t_10 = 1;
-      }
-    }
-    #endif
-    {
-      PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_t_6};
-      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10);
-      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
-      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 52, __pyx_L1_error)
-      __Pyx_GOTREF(__pyx_t_1);
-      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-    }
-    if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
-      PyObject* sequence = __pyx_t_1;
-      Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
-      if (unlikely(size != 3)) {
-        if (size > 3) __Pyx_RaiseTooManyValuesError(3);
-        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
-        __PYX_ERR(0, 52, __pyx_L1_error)
-      }
-      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
-      if (likely(PyTuple_CheckExact(sequence))) {
-        __pyx_t_8 = PyTuple_GET_ITEM(sequence, 0); 
-        __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); 
-        __pyx_t_9 = PyTuple_GET_ITEM(sequence, 2); 
-      } else {
-        __pyx_t_8 = PyList_GET_ITEM(sequence, 0); 
-        __pyx_t_6 = PyList_GET_ITEM(sequence, 1); 
-        __pyx_t_9 = PyList_GET_ITEM(sequence, 2); 
-      }
-      __Pyx_INCREF(__pyx_t_8);
-      __Pyx_INCREF(__pyx_t_6);
-      __Pyx_INCREF(__pyx_t_9);
-      #else
-      __pyx_t_8 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 52, __pyx_L1_error)
-      __Pyx_GOTREF(__pyx_t_8);
-      __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 52, __pyx_L1_error)
-      __Pyx_GOTREF(__pyx_t_6);
-      __pyx_t_9 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 52, __pyx_L1_error)
-      __Pyx_GOTREF(__pyx_t_9);
-      #endif
-      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    } else {
-      Py_ssize_t index = -1;
-      __pyx_t_11 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 52, __pyx_L1_error)
-      __Pyx_GOTREF(__pyx_t_11);
-      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-      __pyx_t_12 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_11);
-      index = 0; __pyx_t_8 = __pyx_t_12(__pyx_t_11); if (unlikely(!__pyx_t_8)) goto __pyx_L9_unpacking_failed;
-      __Pyx_GOTREF(__pyx_t_8);
-      index = 1; __pyx_t_6 = __pyx_t_12(__pyx_t_11); if (unlikely(!__pyx_t_6)) goto __pyx_L9_unpacking_failed;
-      __Pyx_GOTREF(__pyx_t_6);
-      index = 2; __pyx_t_9 = __pyx_t_12(__pyx_t_11); if (unlikely(!__pyx_t_9)) goto __pyx_L9_unpacking_failed;
-      __Pyx_GOTREF(__pyx_t_9);
-      if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_11), 3) < 0) __PYX_ERR(0, 52, __pyx_L1_error)
-      __pyx_t_12 = NULL;
-      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
-      goto __pyx_L10_unpacking_done;
-      __pyx_L9_unpacking_failed:;
-      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
-      __pyx_t_12 = NULL;
-      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
-      __PYX_ERR(0, 52, __pyx_L1_error)
-      __pyx_L10_unpacking_done:;
-    }
-    if (!(likely(((__pyx_t_9) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_9, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 52, __pyx_L1_error)
-    __Pyx_XDECREF_SET(__pyx_v__, __pyx_t_8);
-    __pyx_t_8 = 0;
-    __Pyx_DECREF_SET(__pyx_v__, __pyx_t_6);
-    __pyx_t_6 = 0;
-    __Pyx_XDECREF_SET(__pyx_v_dist, ((PyArrayObject *)__pyx_t_9));
-    __pyx_t_9 = 0;
-
 053:     # out_dict[col_link_names[col_link_idx]] = dist[2]
-
 054:     # out_list.push_back(dist[2])
-
+055:     out_dict[link] = dist
-
    if (unlikely((PyDict_SetItem(__pyx_v_out_dict, __pyx_v_link, ((PyObject *)__pyx_v_dist)) < 0))) __PYX_ERR(0, 55, __pyx_L1_error)
-    __pyx_L3_continue:;
-  }
-
 056: 
-
+057:   return out_dict
-
  __Pyx_XDECREF(__pyx_r);
-  __Pyx_INCREF(__pyx_v_out_dict);
-  __pyx_r = __pyx_v_out_dict;
-  goto __pyx_L0;
-
 058: 
-
 059: # Ignore negative indice checking (i.e., a[-1])
-
 060: @cython.wraparound(False)
-
+061: cpdef int col_check(list sliced_links, list check_links, int len_links, dict global_dict):
-
static PyObject *__pyx_pw_17collision_handler_3col_check(PyObject *__pyx_self, 
+
 012: # Ignore negative indice checking (i.e., a[-1])
+
 013: @cython.wraparound(False)
+
+014: cpdef int col_check(list sliced_links, list check_links, int len_links, dict global_dict):
+
static PyObject *__pyx_pw_17collision_handler_1col_check(PyObject *__pyx_self, 
 #if CYTHON_METH_FASTCALL
 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
 #else
@@ -898,15 +434,15 @@
 }
 
 /* Python wrapper */
-static PyObject *__pyx_pw_17collision_handler_3col_check(PyObject *__pyx_self, 
+static PyObject *__pyx_pw_17collision_handler_1col_check(PyObject *__pyx_self, 
 #if CYTHON_METH_FASTCALL
 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
 #else
 PyObject *__pyx_args, PyObject *__pyx_kwds
 #endif
 ); /*proto*/
-static PyMethodDef __pyx_mdef_17collision_handler_3col_check = {"col_check", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_17collision_handler_3col_check, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
-static PyObject *__pyx_pw_17collision_handler_3col_check(PyObject *__pyx_self, 
+static PyMethodDef __pyx_mdef_17collision_handler_1col_check = {"col_check", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_17collision_handler_1col_check, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
+static PyObject *__pyx_pw_17collision_handler_1col_check(PyObject *__pyx_self, 
 #if CYTHON_METH_FASTCALL
 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
 #else
@@ -956,7 +492,7 @@
           (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
           kw_args--;
         }
-        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 61, __pyx_L3_error)
+        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 14, __pyx_L3_error)
         else goto __pyx_L5_argtuple_error;
         CYTHON_FALLTHROUGH;
         case  1:
@@ -964,9 +500,9 @@
           (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
           kw_args--;
         }
-        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 61, __pyx_L3_error)
+        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 14, __pyx_L3_error)
         else {
-          __Pyx_RaiseArgtupleInvalid("col_check", 1, 4, 4, 1); __PYX_ERR(0, 61, __pyx_L3_error)
+          __Pyx_RaiseArgtupleInvalid("col_check", 1, 4, 4, 1); __PYX_ERR(0, 14, __pyx_L3_error)
         }
         CYTHON_FALLTHROUGH;
         case  2:
@@ -974,9 +510,9 @@
           (void)__Pyx_Arg_NewRef_FASTCALL(values[2]);
           kw_args--;
         }
-        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 61, __pyx_L3_error)
+        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 14, __pyx_L3_error)
         else {
-          __Pyx_RaiseArgtupleInvalid("col_check", 1, 4, 4, 2); __PYX_ERR(0, 61, __pyx_L3_error)
+          __Pyx_RaiseArgtupleInvalid("col_check", 1, 4, 4, 2); __PYX_ERR(0, 14, __pyx_L3_error)
         }
         CYTHON_FALLTHROUGH;
         case  3:
@@ -984,14 +520,14 @@
           (void)__Pyx_Arg_NewRef_FASTCALL(values[3]);
           kw_args--;
         }
-        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 61, __pyx_L3_error)
+        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 14, __pyx_L3_error)
         else {
-          __Pyx_RaiseArgtupleInvalid("col_check", 1, 4, 4, 3); __PYX_ERR(0, 61, __pyx_L3_error)
+          __Pyx_RaiseArgtupleInvalid("col_check", 1, 4, 4, 3); __PYX_ERR(0, 14, __pyx_L3_error)
         }
       }
       if (unlikely(kw_args > 0)) {
         const Py_ssize_t kwd_pos_args = __pyx_nargs;
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "col_check") < 0)) __PYX_ERR(0, 61, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "col_check") < 0)) __PYX_ERR(0, 14, __pyx_L3_error)
       }
     } else if (unlikely(__pyx_nargs != 4)) {
       goto __pyx_L5_argtuple_error;
@@ -1003,12 +539,12 @@
     }
     __pyx_v_sliced_links = ((PyObject*)values[0]);
     __pyx_v_check_links = ((PyObject*)values[1]);
-    __pyx_v_len_links = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_len_links == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 61, __pyx_L3_error)
+    __pyx_v_len_links = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_len_links == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 14, __pyx_L3_error)
     __pyx_v_global_dict = ((PyObject*)values[3]);
   }
   goto __pyx_L6_skip;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("col_check", 1, 4, 4, __pyx_nargs); __PYX_ERR(0, 61, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("col_check", 1, 4, 4, __pyx_nargs); __PYX_ERR(0, 14, __pyx_L3_error)
   __pyx_L6_skip:;
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L3_error:;
@@ -1022,10 +558,10 @@
   __Pyx_RefNannyFinishContext();
   return NULL;
   __pyx_L4_argument_unpacking_done:;
-  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sliced_links), (&PyList_Type), 1, "sliced_links", 1))) __PYX_ERR(0, 61, __pyx_L1_error)
-  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_check_links), (&PyList_Type), 1, "check_links", 1))) __PYX_ERR(0, 61, __pyx_L1_error)
-  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_global_dict), (&PyDict_Type), 1, "global_dict", 1))) __PYX_ERR(0, 61, __pyx_L1_error)
-  __pyx_r = __pyx_pf_17collision_handler_2col_check(__pyx_self, __pyx_v_sliced_links, __pyx_v_check_links, __pyx_v_len_links, __pyx_v_global_dict);
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sliced_links), (&PyList_Type), 1, "sliced_links", 1))) __PYX_ERR(0, 14, __pyx_L1_error)
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_check_links), (&PyList_Type), 1, "check_links", 1))) __PYX_ERR(0, 14, __pyx_L1_error)
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_global_dict), (&PyDict_Type), 1, "global_dict", 1))) __PYX_ERR(0, 14, __pyx_L1_error)
+  __pyx_r = __pyx_pf_17collision_handler_col_check(__pyx_self, __pyx_v_sliced_links, __pyx_v_check_links, __pyx_v_len_links, __pyx_v_global_dict);
   int __pyx_lineno = 0;
   const char *__pyx_filename = NULL;
   int __pyx_clineno = 0;
@@ -1045,11 +581,11 @@
   return __pyx_r;
 }
 
-static PyObject *__pyx_pf_17collision_handler_2col_check(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_sliced_links, PyObject *__pyx_v_check_links, int __pyx_v_len_links, PyObject *__pyx_v_global_dict) {
+static PyObject *__pyx_pf_17collision_handler_col_check(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_sliced_links, PyObject *__pyx_v_check_links, int __pyx_v_len_links, PyObject *__pyx_v_global_dict) {
   PyObject *__pyx_r = NULL;
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __pyx_f_17collision_handler_col_check(__pyx_v_sliced_links, __pyx_v_check_links, __pyx_v_len_links, __pyx_v_global_dict, 0); if (unlikely(__pyx_t_1 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 61, __pyx_L1_error)
-  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 61, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_17collision_handler_col_check(__pyx_v_sliced_links, __pyx_v_check_links, __pyx_v_len_links, __pyx_v_global_dict, 0); if (unlikely(__pyx_t_1 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 14, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 14, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __pyx_r = __pyx_t_2;
   __pyx_t_2 = 0;
@@ -1066,129 +602,129 @@
   return __pyx_r;
 }
 /* … */
-  __pyx_tuple__6 = PyTuple_Pack(4, __pyx_n_s_sliced_links, __pyx_n_s_check_links, __pyx_n_s_len_links, __pyx_n_s_global_dict); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 61, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__6);
-  __Pyx_GIVEREF(__pyx_tuple__6);
+  __pyx_tuple_ = PyTuple_Pack(4, __pyx_n_s_sliced_links, __pyx_n_s_check_links, __pyx_n_s_len_links, __pyx_n_s_global_dict); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 14, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple_);
+  __Pyx_GIVEREF(__pyx_tuple_);
 /* … */
-  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_17collision_handler_3col_check, 0, __pyx_n_s_col_check, NULL, __pyx_n_s_collision_handler, __pyx_d, ((PyObject *)__pyx_codeobj__7)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 61, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_4);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_col_check, __pyx_t_4) < 0) __PYX_ERR(0, 61, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-  __pyx_codeobj__7 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__6, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_armer_cython_collision_handler_p, __pyx_n_s_col_check, 61, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__7)) __PYX_ERR(0, 61, __pyx_L1_error)
-
 062: 
-
 063:   cdef int s_idx
-
 064:   cdef int e_idx
-
 065:   cdef int eval_link_list_len
-
 066:   cdef int col_list_len
-
 067:   cdef int chk_list_len
-
 068:   cdef list t_link_names
-
 069:   cdef list col_list
-
 070:   cdef list c_check_list
-
 071: 
-
+072:   for s_idx in range(len_links):
+ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_17collision_handler_1col_check, 0, __pyx_n_s_col_check, NULL, __pyx_n_s_collision_handler, __pyx_d, ((PyObject *)__pyx_codeobj__2)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 14, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_col_check, __pyx_t_2) < 0) __PYX_ERR(0, 14, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_codeobj__2 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple_, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_armer_cython_collision_handler_p, __pyx_n_s_col_check, 14, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2)) __PYX_ERR(0, 14, __pyx_L1_error) +
 015: 
+
 016:   cdef int s_idx
+
 017:   cdef int e_idx
+
 018:   cdef int eval_link_list_len
+
 019:   cdef int col_list_len
+
 020:   cdef int chk_list_len
+
 021:   cdef list t_link_names
+
 022:   cdef list col_list
+
 023:   cdef list c_check_list
+
 024: 
+
+025:   for s_idx in range(len_links):
  __pyx_t_1 = __pyx_v_len_links;
   __pyx_t_2 = __pyx_t_1;
   for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
     __pyx_v_s_idx = __pyx_t_3;
-
 073:     # Get the current current slice link's collision objects to check against
-
+074:     col_list = list(sliced_links[s_idx].collision)
+
 026:     # Get the current current slice link's collision objects to check against
+
+027:     col_list = list(sliced_links[s_idx].collision)
    if (unlikely(__pyx_v_sliced_links == Py_None)) {
       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
-      __PYX_ERR(0, 74, __pyx_L1_error)
+      __PYX_ERR(0, 27, __pyx_L1_error)
     }
-    __pyx_t_4 = __Pyx_GetItemInt_List(__pyx_v_sliced_links, __pyx_v_s_idx, int, 1, __Pyx_PyInt_From_int, 1, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 74, __pyx_L1_error)
+    __pyx_t_4 = __Pyx_GetItemInt_List(__pyx_v_sliced_links, __pyx_v_s_idx, int, 1, __Pyx_PyInt_From_int, 1, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 27, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
-    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_collision); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 74, __pyx_L1_error)
+    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_collision); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 27, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    __pyx_t_4 = __Pyx_PySequence_ListKeepNew(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 74, __pyx_L1_error)
+    __pyx_t_4 = __Pyx_PySequence_ListKeepNew(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 27, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
     __Pyx_XDECREF_SET(__pyx_v_col_list, ((PyObject*)__pyx_t_4));
     __pyx_t_4 = 0;
-
+075:     col_list_len = len(col_list)
-
    __pyx_t_6 = __Pyx_PyList_GET_SIZE(__pyx_v_col_list); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 75, __pyx_L1_error)
+
+028:     col_list_len = len(col_list)
+
    __pyx_t_6 = __Pyx_PyList_GET_SIZE(__pyx_v_col_list); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 28, __pyx_L1_error)
     __pyx_v_col_list_len = __pyx_t_6;
-
 076: 
-
 077:     # Get target links as list
-
+078:     t_link_names = check_links[s_idx]
+
 029: 
+
 030:     # Get target links as list
+
+031:     t_link_names = check_links[s_idx]
    if (unlikely(__pyx_v_check_links == Py_None)) {
       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
-      __PYX_ERR(0, 78, __pyx_L1_error)
+      __PYX_ERR(0, 31, __pyx_L1_error)
     }
-    __pyx_t_4 = __Pyx_GetItemInt_List(__pyx_v_check_links, __pyx_v_s_idx, int, 1, __Pyx_PyInt_From_int, 1, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 78, __pyx_L1_error)
+    __pyx_t_4 = __Pyx_GetItemInt_List(__pyx_v_check_links, __pyx_v_s_idx, int, 1, __Pyx_PyInt_From_int, 1, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 31, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
-    if (!(likely(PyList_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None) || __Pyx_RaiseUnexpectedTypeError("list", __pyx_t_4))) __PYX_ERR(0, 78, __pyx_L1_error)
+    if (!(likely(PyList_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None) || __Pyx_RaiseUnexpectedTypeError("list", __pyx_t_4))) __PYX_ERR(0, 31, __pyx_L1_error)
     __Pyx_XDECREF_SET(__pyx_v_t_link_names, ((PyObject*)__pyx_t_4));
     __pyx_t_4 = 0;
-
+079:     eval_link_list_len = len(t_link_names)
+
+032:     eval_link_list_len = len(t_link_names)
    if (unlikely(__pyx_v_t_link_names == Py_None)) {
       PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
-      __PYX_ERR(0, 79, __pyx_L1_error)
+      __PYX_ERR(0, 32, __pyx_L1_error)
     }
-    __pyx_t_6 = __Pyx_PyList_GET_SIZE(__pyx_v_t_link_names); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 79, __pyx_L1_error)
+    __pyx_t_6 = __Pyx_PyList_GET_SIZE(__pyx_v_t_link_names); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 32, __pyx_L1_error)
     __pyx_v_eval_link_list_len = __pyx_t_6;
-
+080:     for e_idx in range(eval_link_list_len):
+
+033:     for e_idx in range(eval_link_list_len):
    __pyx_t_7 = __pyx_v_eval_link_list_len;
     __pyx_t_8 = __pyx_t_7;
     for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) {
       __pyx_v_e_idx = __pyx_t_9;
-
 081:       # Extract the evaluation robot link's collision object list for checking
-
+082:       c_check_list = global_dict[t_link_names[e_idx]]
+
 034:       # Extract the evaluation robot link's collision object list for checking
+
+035:       c_check_list = global_dict[t_link_names[e_idx]]
      if (unlikely(__pyx_v_global_dict == Py_None)) {
         PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
-        __PYX_ERR(0, 82, __pyx_L1_error)
+        __PYX_ERR(0, 35, __pyx_L1_error)
       }
       if (unlikely(__pyx_v_t_link_names == Py_None)) {
         PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
-        __PYX_ERR(0, 82, __pyx_L1_error)
+        __PYX_ERR(0, 35, __pyx_L1_error)
       }
-      __pyx_t_4 = __Pyx_GetItemInt_List(__pyx_v_t_link_names, __pyx_v_e_idx, int, 1, __Pyx_PyInt_From_int, 1, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 82, __pyx_L1_error)
+      __pyx_t_4 = __Pyx_GetItemInt_List(__pyx_v_t_link_names, __pyx_v_e_idx, int, 1, __Pyx_PyInt_From_int, 1, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 35, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_4);
-      __pyx_t_5 = __Pyx_PyDict_GetItem(__pyx_v_global_dict, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 82, __pyx_L1_error)
+      __pyx_t_5 = __Pyx_PyDict_GetItem(__pyx_v_global_dict, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 35, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_5);
       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-      if (!(likely(PyList_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None) || __Pyx_RaiseUnexpectedTypeError("list", __pyx_t_5))) __PYX_ERR(0, 82, __pyx_L1_error)
+      if (!(likely(PyList_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None) || __Pyx_RaiseUnexpectedTypeError("list", __pyx_t_5))) __PYX_ERR(0, 35, __pyx_L1_error)
       __Pyx_XDECREF_SET(__pyx_v_c_check_list, ((PyObject*)__pyx_t_5));
       __pyx_t_5 = 0;
-
+083:       chk_list_len = len(c_check_list)
+
+036:       chk_list_len = len(c_check_list)
      if (unlikely(__pyx_v_c_check_list == Py_None)) {
         PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
-        __PYX_ERR(0, 83, __pyx_L1_error)
+        __PYX_ERR(0, 36, __pyx_L1_error)
       }
-      __pyx_t_6 = __Pyx_PyList_GET_SIZE(__pyx_v_c_check_list); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 83, __pyx_L1_error)
+      __pyx_t_6 = __Pyx_PyList_GET_SIZE(__pyx_v_c_check_list); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 36, __pyx_L1_error)
       __pyx_v_chk_list_len = __pyx_t_6;
-
 084: 
-
+085:       for chk_idx in range(chk_list_len):
+
 037: 
+
+038:       for chk_idx in range(chk_list_len):
      __pyx_t_10 = __pyx_v_chk_list_len;
       __pyx_t_11 = __pyx_t_10;
       for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) {
         __pyx_v_chk_idx = __pyx_t_12;
-
+086:         obj = c_check_list[chk_idx]
+
+039:         obj = c_check_list[chk_idx]
        if (unlikely(__pyx_v_c_check_list == Py_None)) {
           PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
-          __PYX_ERR(0, 86, __pyx_L1_error)
+          __PYX_ERR(0, 39, __pyx_L1_error)
         }
-        __pyx_t_5 = __Pyx_GetItemInt_List(__pyx_v_c_check_list, __pyx_v_chk_idx, int, 1, __Pyx_PyInt_From_int, 1, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 86, __pyx_L1_error)
+        __pyx_t_5 = __Pyx_GetItemInt_List(__pyx_v_c_check_list, __pyx_v_chk_idx, int, 1, __Pyx_PyInt_From_int, 1, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 39, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_5);
         __Pyx_XDECREF_SET(__pyx_v_obj, __pyx_t_5);
         __pyx_t_5 = 0;
-
 087: 
-
+088:         for col_idx in range(col_list_len):
+
 040: 
+
+041:         for col_idx in range(col_list_len):
        __pyx_t_13 = __pyx_v_col_list_len;
         __pyx_t_14 = __pyx_t_13;
         for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_14; __pyx_t_15+=1) {
           __pyx_v_col_idx = __pyx_t_15;
-
+089:           t_obj = col_list[col_idx]
-
          __pyx_t_5 = __Pyx_GetItemInt_List(__pyx_v_col_list, __pyx_v_col_idx, int, 1, __Pyx_PyInt_From_int, 1, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 89, __pyx_L1_error)
+
+042:           t_obj = col_list[col_idx]
+
          __pyx_t_5 = __Pyx_GetItemInt_List(__pyx_v_col_list, __pyx_v_col_idx, int, 1, __Pyx_PyInt_From_int, 1, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 42, __pyx_L1_error)
           __Pyx_GOTREF(__pyx_t_5);
           __Pyx_XDECREF_SET(__pyx_v_t_obj, __pyx_t_5);
           __pyx_t_5 = 0;
-
 090: 
-
 091:           # Get the distance for comparison
-
 092:           # print(f"obj: {t_obj}")
-
+093:           d, _, _ = t_obj.closest_point(obj)
-
          __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_t_obj, __pyx_n_s_closest_point); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 93, __pyx_L1_error)
+
 043: 
+
 044:           # Get the distance for comparison
+
 045:           # print(f"obj: {t_obj}")
+
+046:           d, _, _ = t_obj.closest_point(obj)
+
          __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_t_obj, __pyx_n_s_closest_point); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 46, __pyx_L1_error)
           __Pyx_GOTREF(__pyx_t_4);
           __pyx_t_16 = NULL;
           __pyx_t_17 = 0;
@@ -1208,7 +744,7 @@
             PyObject *__pyx_callargs[2] = {__pyx_t_16, __pyx_v_obj};
             __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_17, 1+__pyx_t_17);
             __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
-            if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 93, __pyx_L1_error)
+            if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 46, __pyx_L1_error)
             __Pyx_GOTREF(__pyx_t_5);
             __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
           }
@@ -1218,7 +754,7 @@
             if (unlikely(size != 3)) {
               if (size > 3) __Pyx_RaiseTooManyValuesError(3);
               else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
-              __PYX_ERR(0, 93, __pyx_L1_error)
+              __PYX_ERR(0, 46, __pyx_L1_error)
             }
             #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
             if (likely(PyTuple_CheckExact(sequence))) {
@@ -1234,17 +770,17 @@
             __Pyx_INCREF(__pyx_t_16);
             __Pyx_INCREF(__pyx_t_18);
             #else
-            __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 93, __pyx_L1_error)
+            __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 46, __pyx_L1_error)
             __Pyx_GOTREF(__pyx_t_4);
-            __pyx_t_16 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 93, __pyx_L1_error)
+            __pyx_t_16 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 46, __pyx_L1_error)
             __Pyx_GOTREF(__pyx_t_16);
-            __pyx_t_18 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 93, __pyx_L1_error)
+            __pyx_t_18 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 46, __pyx_L1_error)
             __Pyx_GOTREF(__pyx_t_18);
             #endif
             __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
           } else {
             Py_ssize_t index = -1;
-            __pyx_t_19 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 93, __pyx_L1_error)
+            __pyx_t_19 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 46, __pyx_L1_error)
             __Pyx_GOTREF(__pyx_t_19);
             __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
             __pyx_t_20 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_19);
@@ -1254,7 +790,7 @@
             __Pyx_GOTREF(__pyx_t_16);
             index = 2; __pyx_t_18 = __pyx_t_20(__pyx_t_19); if (unlikely(!__pyx_t_18)) goto __pyx_L11_unpacking_failed;
             __Pyx_GOTREF(__pyx_t_18);
-            if (__Pyx_IternextUnpackEndCheck(__pyx_t_20(__pyx_t_19), 3) < 0) __PYX_ERR(0, 93, __pyx_L1_error)
+            if (__Pyx_IternextUnpackEndCheck(__pyx_t_20(__pyx_t_19), 3) < 0) __PYX_ERR(0, 46, __pyx_L1_error)
             __pyx_t_20 = NULL;
             __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
             goto __pyx_L12_unpacking_done;
@@ -1262,7 +798,7 @@
             __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
             __pyx_t_20 = NULL;
             if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
-            __PYX_ERR(0, 93, __pyx_L1_error)
+            __PYX_ERR(0, 46, __pyx_L1_error)
             __pyx_L12_unpacking_done:;
           }
           __Pyx_XDECREF_SET(__pyx_v_d, __pyx_t_4);
@@ -1271,16 +807,16 @@
           __pyx_t_16 = 0;
           __Pyx_DECREF_SET(__pyx_v__, __pyx_t_18);
           __pyx_t_18 = 0;
-
 094:           # print(f"d is: {d}")
-
+095:           if d is not None and d <= 0:
+
 047:           # print(f"d is: {d}")
+
+048:           if d is not None and d <= 0:
          __pyx_t_22 = (__pyx_v_d != Py_None);
           if (__pyx_t_22) {
           } else {
             __pyx_t_21 = __pyx_t_22;
             goto __pyx_L14_bool_binop_done;
           }
-          __pyx_t_5 = PyObject_RichCompare(__pyx_v_d, __pyx_int_0, Py_LE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 95, __pyx_L1_error)
-          __pyx_t_22 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_22 < 0))) __PYX_ERR(0, 95, __pyx_L1_error)
+          __pyx_t_5 = PyObject_RichCompare(__pyx_v_d, __pyx_int_0, Py_LE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 48, __pyx_L1_error)
+          __pyx_t_22 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_22 < 0))) __PYX_ERR(0, 48, __pyx_L1_error)
           __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
           __pyx_t_21 = __pyx_t_22;
           __pyx_L14_bool_binop_done:;
@@ -1291,20 +827,20 @@
       }
     }
   }
-
 096:             # Returns the link idx in collision
-
+097:             return s_idx
+
 049:             # Returns the link idx in collision
+
+050:             return s_idx
            __pyx_r = __pyx_v_s_idx;
             goto __pyx_L0;
-
 098: 
-
 099:   # Got here without issue
-
+100:   return -1
+
 051: 
+
 052:   # Got here without issue
+
+053:   return -1
  __pyx_r = -1;
   goto __pyx_L0;
-
 101: 
-
 102: # Ignore negative indice checking (i.e., a[-1])
-
 103: @cython.wraparound(False)
-
+104: cpdef int global_check(str robot_name,
-
static PyObject *__pyx_pw_17collision_handler_5global_check(PyObject *__pyx_self, 
+
 054: 
+
 055: # Ignore negative indice checking (i.e., a[-1])
+
 056: @cython.wraparound(False)
+
+057: cpdef int global_check(str robot_name,
+
static PyObject *__pyx_pw_17collision_handler_3global_check(PyObject *__pyx_self, 
 #if CYTHON_METH_FASTCALL
 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
 #else
@@ -1358,15 +894,15 @@
 }
 
 /* Python wrapper */
-static PyObject *__pyx_pw_17collision_handler_5global_check(PyObject *__pyx_self, 
+static PyObject *__pyx_pw_17collision_handler_3global_check(PyObject *__pyx_self, 
 #if CYTHON_METH_FASTCALL
 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
 #else
 PyObject *__pyx_args, PyObject *__pyx_kwds
 #endif
 ); /*proto*/
-static PyMethodDef __pyx_mdef_17collision_handler_5global_check = {"global_check", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_17collision_handler_5global_check, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
-static PyObject *__pyx_pw_17collision_handler_5global_check(PyObject *__pyx_self, 
+static PyMethodDef __pyx_mdef_17collision_handler_3global_check = {"global_check", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_17collision_handler_3global_check, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
+static PyObject *__pyx_pw_17collision_handler_3global_check(PyObject *__pyx_self, 
 #if CYTHON_METH_FASTCALL
 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
 #else
@@ -1428,7 +964,7 @@
           (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
           kw_args--;
         }
-        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 104, __pyx_L3_error)
+        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 57, __pyx_L3_error)
         else goto __pyx_L5_argtuple_error;
         CYTHON_FALLTHROUGH;
         case  1:
@@ -1436,9 +972,9 @@
           (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
           kw_args--;
         }
-        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 104, __pyx_L3_error)
+        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 57, __pyx_L3_error)
         else {
-          __Pyx_RaiseArgtupleInvalid("global_check", 1, 8, 8, 1); __PYX_ERR(0, 104, __pyx_L3_error)
+          __Pyx_RaiseArgtupleInvalid("global_check", 1, 8, 8, 1); __PYX_ERR(0, 57, __pyx_L3_error)
         }
         CYTHON_FALLTHROUGH;
         case  2:
@@ -1446,9 +982,9 @@
           (void)__Pyx_Arg_NewRef_FASTCALL(values[2]);
           kw_args--;
         }
-        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 104, __pyx_L3_error)
+        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 57, __pyx_L3_error)
         else {
-          __Pyx_RaiseArgtupleInvalid("global_check", 1, 8, 8, 2); __PYX_ERR(0, 104, __pyx_L3_error)
+          __Pyx_RaiseArgtupleInvalid("global_check", 1, 8, 8, 2); __PYX_ERR(0, 57, __pyx_L3_error)
         }
         CYTHON_FALLTHROUGH;
         case  3:
@@ -1456,9 +992,9 @@
           (void)__Pyx_Arg_NewRef_FASTCALL(values[3]);
           kw_args--;
         }
-        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 104, __pyx_L3_error)
+        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 57, __pyx_L3_error)
         else {
-          __Pyx_RaiseArgtupleInvalid("global_check", 1, 8, 8, 3); __PYX_ERR(0, 104, __pyx_L3_error)
+          __Pyx_RaiseArgtupleInvalid("global_check", 1, 8, 8, 3); __PYX_ERR(0, 57, __pyx_L3_error)
         }
         CYTHON_FALLTHROUGH;
         case  4:
@@ -1466,9 +1002,9 @@
           (void)__Pyx_Arg_NewRef_FASTCALL(values[4]);
           kw_args--;
         }
-        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 104, __pyx_L3_error)
+        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 57, __pyx_L3_error)
         else {
-          __Pyx_RaiseArgtupleInvalid("global_check", 1, 8, 8, 4); __PYX_ERR(0, 104, __pyx_L3_error)
+          __Pyx_RaiseArgtupleInvalid("global_check", 1, 8, 8, 4); __PYX_ERR(0, 57, __pyx_L3_error)
         }
         CYTHON_FALLTHROUGH;
         case  5:
@@ -1476,9 +1012,9 @@
           (void)__Pyx_Arg_NewRef_FASTCALL(values[5]);
           kw_args--;
         }
-        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 104, __pyx_L3_error)
+        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 57, __pyx_L3_error)
         else {
-          __Pyx_RaiseArgtupleInvalid("global_check", 1, 8, 8, 5); __PYX_ERR(0, 104, __pyx_L3_error)
+          __Pyx_RaiseArgtupleInvalid("global_check", 1, 8, 8, 5); __PYX_ERR(0, 57, __pyx_L3_error)
         }
         CYTHON_FALLTHROUGH;
         case  6:
@@ -1486,9 +1022,9 @@
           (void)__Pyx_Arg_NewRef_FASTCALL(values[6]);
           kw_args--;
         }
-        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 104, __pyx_L3_error)
+        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 57, __pyx_L3_error)
         else {
-          __Pyx_RaiseArgtupleInvalid("global_check", 1, 8, 8, 6); __PYX_ERR(0, 104, __pyx_L3_error)
+          __Pyx_RaiseArgtupleInvalid("global_check", 1, 8, 8, 6); __PYX_ERR(0, 57, __pyx_L3_error)
         }
         CYTHON_FALLTHROUGH;
         case  7:
@@ -1496,14 +1032,14 @@
           (void)__Pyx_Arg_NewRef_FASTCALL(values[7]);
           kw_args--;
         }
-        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 104, __pyx_L3_error)
+        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 57, __pyx_L3_error)
         else {
-          __Pyx_RaiseArgtupleInvalid("global_check", 1, 8, 8, 7); __PYX_ERR(0, 104, __pyx_L3_error)
+          __Pyx_RaiseArgtupleInvalid("global_check", 1, 8, 8, 7); __PYX_ERR(0, 57, __pyx_L3_error)
         }
       }
       if (unlikely(kw_args > 0)) {
         const Py_ssize_t kwd_pos_args = __pyx_nargs;
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "global_check") < 0)) __PYX_ERR(0, 104, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "global_check") < 0)) __PYX_ERR(0, 57, __pyx_L3_error)
       }
     } else if (unlikely(__pyx_nargs != 8)) {
       goto __pyx_L5_argtuple_error;
@@ -1519,16 +1055,16 @@
     }
     __pyx_v_robot_name = ((PyObject*)values[0]);
     __pyx_v_robot_names = ((PyObject*)values[1]);
-    __pyx_v_len_robots = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_len_robots == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 106, __pyx_L3_error)
+    __pyx_v_len_robots = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_len_robots == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 59, __pyx_L3_error)
     __pyx_v_robot_links = ((PyObject*)values[3]);
-    __pyx_v_len_links = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_len_links == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 108, __pyx_L3_error)
+    __pyx_v_len_links = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_len_links == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 61, __pyx_L3_error)
     __pyx_v_global_dict = ((PyObject*)values[5]);
     __pyx_v_overlap_dict = ((PyObject*)values[6]);
     __pyx_v_check_links = ((PyObject*)values[7]);
   }
   goto __pyx_L6_skip;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("global_check", 1, 8, 8, __pyx_nargs); __PYX_ERR(0, 104, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("global_check", 1, 8, 8, __pyx_nargs); __PYX_ERR(0, 57, __pyx_L3_error)
   __pyx_L6_skip:;
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L3_error:;
@@ -1542,13 +1078,13 @@
   __Pyx_RefNannyFinishContext();
   return NULL;
   __pyx_L4_argument_unpacking_done:;
-  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_robot_name), (&PyString_Type), 1, "robot_name", 1))) __PYX_ERR(0, 104, __pyx_L1_error)
-  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_robot_names), (&PyList_Type), 1, "robot_names", 1))) __PYX_ERR(0, 105, __pyx_L1_error)
-  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_robot_links), (&PyList_Type), 1, "robot_links", 1))) __PYX_ERR(0, 107, __pyx_L1_error)
-  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_global_dict), (&PyDict_Type), 1, "global_dict", 1))) __PYX_ERR(0, 109, __pyx_L1_error)
-  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_overlap_dict), (&PyDict_Type), 1, "overlap_dict", 1))) __PYX_ERR(0, 110, __pyx_L1_error)
-  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_check_links), (&PyList_Type), 1, "check_links", 1))) __PYX_ERR(0, 111, __pyx_L1_error)
-  __pyx_r = __pyx_pf_17collision_handler_4global_check(__pyx_self, __pyx_v_robot_name, __pyx_v_robot_names, __pyx_v_len_robots, __pyx_v_robot_links, __pyx_v_len_links, __pyx_v_global_dict, __pyx_v_overlap_dict, __pyx_v_check_links);
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_robot_name), (&PyString_Type), 1, "robot_name", 1))) __PYX_ERR(0, 57, __pyx_L1_error)
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_robot_names), (&PyList_Type), 1, "robot_names", 1))) __PYX_ERR(0, 58, __pyx_L1_error)
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_robot_links), (&PyList_Type), 1, "robot_links", 1))) __PYX_ERR(0, 60, __pyx_L1_error)
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_global_dict), (&PyDict_Type), 1, "global_dict", 1))) __PYX_ERR(0, 62, __pyx_L1_error)
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_overlap_dict), (&PyDict_Type), 1, "overlap_dict", 1))) __PYX_ERR(0, 63, __pyx_L1_error)
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_check_links), (&PyList_Type), 1, "check_links", 1))) __PYX_ERR(0, 64, __pyx_L1_error)
+  __pyx_r = __pyx_pf_17collision_handler_2global_check(__pyx_self, __pyx_v_robot_name, __pyx_v_robot_names, __pyx_v_len_robots, __pyx_v_robot_links, __pyx_v_len_links, __pyx_v_global_dict, __pyx_v_overlap_dict, __pyx_v_check_links);
   int __pyx_lineno = 0;
   const char *__pyx_filename = NULL;
   int __pyx_clineno = 0;
@@ -1568,11 +1104,11 @@
   return __pyx_r;
 }
 
-static PyObject *__pyx_pf_17collision_handler_4global_check(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_robot_name, PyObject *__pyx_v_robot_names, int __pyx_v_len_robots, PyObject *__pyx_v_robot_links, int __pyx_v_len_links, PyObject *__pyx_v_global_dict, PyObject *__pyx_v_overlap_dict, PyObject *__pyx_v_check_links) {
+static PyObject *__pyx_pf_17collision_handler_2global_check(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_robot_name, PyObject *__pyx_v_robot_names, int __pyx_v_len_robots, PyObject *__pyx_v_robot_links, int __pyx_v_len_links, PyObject *__pyx_v_global_dict, PyObject *__pyx_v_overlap_dict, PyObject *__pyx_v_check_links) {
   PyObject *__pyx_r = NULL;
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __pyx_f_17collision_handler_global_check(__pyx_v_robot_name, __pyx_v_robot_names, __pyx_v_len_robots, __pyx_v_robot_links, __pyx_v_len_links, __pyx_v_global_dict, __pyx_v_overlap_dict, __pyx_v_check_links, 0); if (unlikely(__pyx_t_1 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 104, __pyx_L1_error)
-  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 104, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_17collision_handler_global_check(__pyx_v_robot_name, __pyx_v_robot_names, __pyx_v_len_robots, __pyx_v_robot_links, __pyx_v_len_links, __pyx_v_global_dict, __pyx_v_overlap_dict, __pyx_v_check_links, 0); if (unlikely(__pyx_t_1 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 57, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 57, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __pyx_r = __pyx_t_2;
   __pyx_t_2 = 0;
@@ -1589,70 +1125,70 @@
   return __pyx_r;
 }
 /* … */
-  __pyx_tuple__8 = PyTuple_Pack(8, __pyx_n_s_robot_name, __pyx_n_s_robot_names, __pyx_n_s_len_robots, __pyx_n_s_robot_links, __pyx_n_s_len_links, __pyx_n_s_global_dict, __pyx_n_s_overlap_dict, __pyx_n_s_check_links); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 104, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__8);
-  __Pyx_GIVEREF(__pyx_tuple__8);
+  __pyx_tuple__3 = PyTuple_Pack(8, __pyx_n_s_robot_name, __pyx_n_s_robot_names, __pyx_n_s_len_robots, __pyx_n_s_robot_links, __pyx_n_s_len_links, __pyx_n_s_global_dict, __pyx_n_s_overlap_dict, __pyx_n_s_check_links); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 57, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__3);
+  __Pyx_GIVEREF(__pyx_tuple__3);
 /* … */
-  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_17collision_handler_5global_check, 0, __pyx_n_s_global_check, NULL, __pyx_n_s_collision_handler, __pyx_d, ((PyObject *)__pyx_codeobj__9)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 104, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_4);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_global_check, __pyx_t_4) < 0) __PYX_ERR(0, 104, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-  __pyx_codeobj__9 = (PyObject*)__Pyx_PyCode_New(8, 0, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__8, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_armer_cython_collision_handler_p, __pyx_n_s_global_check, 104, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__9)) __PYX_ERR(0, 104, __pyx_L1_error)
-
 105:                       list robot_names,
-
 106:                       int len_robots,
-
 107:                       list robot_links,
-
 108:                       int len_links,
-
 109:                       dict global_dict,
-
 110:                       dict overlap_dict,
-
 111:                       list check_links):
-
 112:   cdef list c_ignore_list
-
 113:   cdef list c_check_list
-
 114:   cdef list col_list
-
 115: 
-
 116:   cdef str r_name
-
 117:   cdef str l_name
-
 118:   cdef str t_l_name
-
 119: 
-
 120:   cdef int r_idx
-
 121:   cdef int col_idx
-
 122:   cdef int chk_idx
-
 123:   cdef int l_idx
-
 124: 
-
 125:   cdef int col_list_len
-
 126:   cdef int chk_list_len
-
 127: 
-
 128:   # Iterate through all instantiated robots
-
 129:   # - there may be more than one robot, so loop through each
-
 130:   # - for the current robot, we want to evaluate one of the sliced links over the current dictionary of links
-
 131:   #   - example, panda robot slice link 1 is panda_hand  
-
+132:   for r_idx in range(len_robots):
+ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_17collision_handler_3global_check, 0, __pyx_n_s_global_check, NULL, __pyx_n_s_collision_handler, __pyx_d, ((PyObject *)__pyx_codeobj__4)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 57, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_global_check, __pyx_t_2) < 0) __PYX_ERR(0, 57, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_codeobj__4 = (PyObject*)__Pyx_PyCode_New(8, 0, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__3, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_armer_cython_collision_handler_p, __pyx_n_s_global_check, 57, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__4)) __PYX_ERR(0, 57, __pyx_L1_error) +
 058:                       list robot_names,
+
 059:                       int len_robots,
+
 060:                       list robot_links,
+
 061:                       int len_links,
+
 062:                       dict global_dict,
+
 063:                       dict overlap_dict,
+
 064:                       list check_links):
+
 065:   cdef list c_ignore_list
+
 066:   cdef list c_check_list
+
 067:   cdef list col_list
+
 068: 
+
 069:   cdef str r_name
+
 070:   cdef str l_name
+
 071:   cdef str t_l_name
+
 072: 
+
 073:   cdef int r_idx
+
 074:   cdef int col_idx
+
 075:   cdef int chk_idx
+
 076:   cdef int l_idx
+
 077: 
+
 078:   cdef int col_list_len
+
 079:   cdef int chk_list_len
+
 080: 
+
 081:   # Iterate through all instantiated robots
+
 082:   # - there may be more than one robot, so loop through each
+
 083:   # - for the current robot, we want to evaluate one of the sliced links over the current dictionary of links
+
 084:   #   - example, panda robot slice link 1 is panda_hand  
+
+085:   for r_idx in range(len_robots):
  __pyx_t_1 = __pyx_v_len_robots;
   __pyx_t_2 = __pyx_t_1;
   for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
     __pyx_v_r_idx = __pyx_t_3;
-
 133:     # Get the robot name for evaluation
-
+134:     r_name = robot_names[r_idx]
+
 086:     # Get the robot name for evaluation
+
+087:     r_name = robot_names[r_idx]
    if (unlikely(__pyx_v_robot_names == Py_None)) {
       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
-      __PYX_ERR(0, 134, __pyx_L1_error)
+      __PYX_ERR(0, 87, __pyx_L1_error)
     }
-    __pyx_t_4 = __Pyx_GetItemInt_List(__pyx_v_robot_names, __pyx_v_r_idx, int, 1, __Pyx_PyInt_From_int, 1, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 134, __pyx_L1_error)
+    __pyx_t_4 = __Pyx_GetItemInt_List(__pyx_v_robot_names, __pyx_v_r_idx, int, 1, __Pyx_PyInt_From_int, 1, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 87, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
-    if (!(likely(PyString_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_4))) __PYX_ERR(0, 134, __pyx_L1_error)
+    if (!(likely(PyString_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_4))) __PYX_ERR(0, 87, __pyx_L1_error)
     __Pyx_XDECREF_SET(__pyx_v_r_name, ((PyObject*)__pyx_t_4));
     __pyx_t_4 = 0;
-
 135:     # DEBUGGING
-
 136:     # print(f"NEW robot: {robot_names[idx]}" )
-
 137: 
-
 138:     # Loop though the global dictionary of links for robot in evaluation
-
+139:     for l_name in global_dict[r_name].copy():
+
 088:     # DEBUGGING
+
 089:     # print(f"NEW robot: {robot_names[idx]}" )
+
 090: 
+
 091:     # Loop though the global dictionary of links for robot in evaluation
+
+092:     for l_name in global_dict[r_name].copy():
    if (unlikely(__pyx_v_global_dict == Py_None)) {
       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
-      __PYX_ERR(0, 139, __pyx_L1_error)
+      __PYX_ERR(0, 92, __pyx_L1_error)
     }
-    __pyx_t_5 = __Pyx_PyDict_GetItem(__pyx_v_global_dict, __pyx_v_r_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 139, __pyx_L1_error)
+    __pyx_t_5 = __Pyx_PyDict_GetItem(__pyx_v_global_dict, __pyx_v_r_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 92, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
-    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_copy); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 139, __pyx_L1_error)
+    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_copy); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 92, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_6);
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
     __pyx_t_5 = NULL;
@@ -1673,7 +1209,7 @@
       PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
       __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_7, 0+__pyx_t_7);
       __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
-      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 139, __pyx_L1_error)
+      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 92, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_4);
       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
     }
@@ -1682,9 +1218,9 @@
       __pyx_t_8 = 0;
       __pyx_t_9 = NULL;
     } else {
-      __pyx_t_8 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 139, __pyx_L1_error)
+      __pyx_t_8 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 92, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_6);
-      __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 139, __pyx_L1_error)
+      __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 92, __pyx_L1_error)
     }
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
     for (;;) {
@@ -1693,28 +1229,28 @@
           {
             Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_6);
             #if !CYTHON_ASSUME_SAFE_MACROS
-            if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 139, __pyx_L1_error)
+            if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 92, __pyx_L1_error)
             #endif
             if (__pyx_t_8 >= __pyx_temp) break;
           }
           #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
-          __pyx_t_4 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_8); __Pyx_INCREF(__pyx_t_4); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 139, __pyx_L1_error)
+          __pyx_t_4 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_8); __Pyx_INCREF(__pyx_t_4); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 92, __pyx_L1_error)
           #else
-          __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_6, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 139, __pyx_L1_error)
+          __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_6, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 92, __pyx_L1_error)
           __Pyx_GOTREF(__pyx_t_4);
           #endif
         } else {
           {
             Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_6);
             #if !CYTHON_ASSUME_SAFE_MACROS
-            if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 139, __pyx_L1_error)
+            if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 92, __pyx_L1_error)
             #endif
             if (__pyx_t_8 >= __pyx_temp) break;
           }
           #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
-          __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_8); __Pyx_INCREF(__pyx_t_4); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 139, __pyx_L1_error)
+          __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_8); __Pyx_INCREF(__pyx_t_4); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 92, __pyx_L1_error)
           #else
-          __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_6, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 139, __pyx_L1_error)
+          __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_6, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 92, __pyx_L1_error)
           __Pyx_GOTREF(__pyx_t_4);
           #endif
         }
@@ -1724,40 +1260,40 @@
           PyObject* exc_type = PyErr_Occurred();
           if (exc_type) {
             if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
-            else __PYX_ERR(0, 139, __pyx_L1_error)
+            else __PYX_ERR(0, 92, __pyx_L1_error)
           }
           break;
         }
         __Pyx_GOTREF(__pyx_t_4);
       }
-      if (!(likely(PyString_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_4))) __PYX_ERR(0, 139, __pyx_L1_error)
+      if (!(likely(PyString_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_4))) __PYX_ERR(0, 92, __pyx_L1_error)
       __Pyx_XDECREF_SET(__pyx_v_l_name, ((PyObject*)__pyx_t_4));
       __pyx_t_4 = 0;
 /* … */
     }
     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
   }
-
 140:       # DEBUGGING
-
 141:       # print(f"r_name: {r_name} | l_name: {l_name}")
-
 142: 
-
 143:       # Extract the evaluation robot link's collision object list for checking
-
+144:       c_check_list = global_dict[r_name][l_name]
+
 093:       # DEBUGGING
+
 094:       # print(f"r_name: {r_name} | l_name: {l_name}")
+
 095: 
+
 096:       # Extract the evaluation robot link's collision object list for checking
+
+097:       c_check_list = global_dict[r_name][l_name]
      if (unlikely(__pyx_v_global_dict == Py_None)) {
         PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
-        __PYX_ERR(0, 144, __pyx_L1_error)
+        __PYX_ERR(0, 97, __pyx_L1_error)
       }
-      __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_global_dict, __pyx_v_r_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 144, __pyx_L1_error)
+      __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_global_dict, __pyx_v_r_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 97, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_4);
-      __pyx_t_5 = __Pyx_PyObject_Dict_GetItem(__pyx_t_4, __pyx_v_l_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 144, __pyx_L1_error)
+      __pyx_t_5 = __Pyx_PyObject_Dict_GetItem(__pyx_t_4, __pyx_v_l_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 97, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_5);
       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-      if (!(likely(PyList_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None) || __Pyx_RaiseUnexpectedTypeError("list", __pyx_t_5))) __PYX_ERR(0, 144, __pyx_L1_error)
+      if (!(likely(PyList_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None) || __Pyx_RaiseUnexpectedTypeError("list", __pyx_t_5))) __PYX_ERR(0, 97, __pyx_L1_error)
       __Pyx_XDECREF_SET(__pyx_v_c_check_list, ((PyObject*)__pyx_t_5));
       __pyx_t_5 = 0;
-
 145: 
-
 146:       # Handle self checking and populate overlap links for ignoring
-
+147:       if robot_name == r_name and l_name in overlap_dict:
-
      __pyx_t_11 = (__Pyx_PyString_Equals(__pyx_v_robot_name, __pyx_v_r_name, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 147, __pyx_L1_error)
+
 098: 
+
 099:       # Handle self checking and populate overlap links for ignoring
+
+100:       if robot_name == r_name and l_name in overlap_dict:
+
      __pyx_t_11 = (__Pyx_PyString_Equals(__pyx_v_robot_name, __pyx_v_r_name, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 100, __pyx_L1_error)
       if (__pyx_t_11) {
       } else {
         __pyx_t_10 = __pyx_t_11;
@@ -1765,144 +1301,144 @@
       }
       if (unlikely(__pyx_v_overlap_dict == Py_None)) {
         PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
-        __PYX_ERR(0, 147, __pyx_L1_error)
+        __PYX_ERR(0, 100, __pyx_L1_error)
       }
-      __pyx_t_11 = (__Pyx_PyDict_ContainsTF(__pyx_v_l_name, __pyx_v_overlap_dict, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 147, __pyx_L1_error)
+      __pyx_t_11 = (__Pyx_PyDict_ContainsTF(__pyx_v_l_name, __pyx_v_overlap_dict, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 100, __pyx_L1_error)
       __pyx_t_10 = __pyx_t_11;
       __pyx_L8_bool_binop_done:;
       if (__pyx_t_10) {
 /* … */
         goto __pyx_L7;
       }
-
+148:         c_ignore_list = overlap_dict[l_name]
+
+101:         c_ignore_list = overlap_dict[l_name]
        if (unlikely(__pyx_v_overlap_dict == Py_None)) {
           PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
-          __PYX_ERR(0, 148, __pyx_L1_error)
+          __PYX_ERR(0, 101, __pyx_L1_error)
         }
-        __pyx_t_5 = __Pyx_PyDict_GetItem(__pyx_v_overlap_dict, __pyx_v_l_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 148, __pyx_L1_error)
+        __pyx_t_5 = __Pyx_PyDict_GetItem(__pyx_v_overlap_dict, __pyx_v_l_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 101, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_5);
-        if (!(likely(PyList_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None) || __Pyx_RaiseUnexpectedTypeError("list", __pyx_t_5))) __PYX_ERR(0, 148, __pyx_L1_error)
+        if (!(likely(PyList_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None) || __Pyx_RaiseUnexpectedTypeError("list", __pyx_t_5))) __PYX_ERR(0, 101, __pyx_L1_error)
         __Pyx_XDECREF_SET(__pyx_v_c_ignore_list, ((PyObject*)__pyx_t_5));
         __pyx_t_5 = 0;
-
 149:       else:
-
+150:         c_ignore_list = []
+
 102:       else:
+
+103:         c_ignore_list = []
      /*else*/ {
-        __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 150, __pyx_L1_error)
+        __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 103, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_5);
         __Pyx_XDECREF_SET(__pyx_v_c_ignore_list, ((PyObject*)__pyx_t_5));
         __pyx_t_5 = 0;
       }
       __pyx_L7:;
-
 151: 
-
 152:       # Local checking of evaluation robot's link with robot's target links
-
 153:       # NOTE: target links are defined as those links of particular note for checking
-
 154:       #       speed up achived by limiting this list 
-
 155:       #       (search space from end-effector down to base_link, sliced as needed)
-
+156:       for l_idx in range(len_links):
+
 104: 
+
 105:       # Local checking of evaluation robot's link with robot's target links
+
 106:       # NOTE: target links are defined as those links of particular note for checking
+
 107:       #       speed up achived by limiting this list 
+
 108:       #       (search space from end-effector down to base_link, sliced as needed)
+
+109:       for l_idx in range(len_links):
      __pyx_t_7 = __pyx_v_len_links;
       __pyx_t_12 = __pyx_t_7;
       for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) {
         __pyx_v_l_idx = __pyx_t_13;
-
+157:         link = robot_links[l_idx]
+
+110:         link = robot_links[l_idx]
        if (unlikely(__pyx_v_robot_links == Py_None)) {
           PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
-          __PYX_ERR(0, 157, __pyx_L1_error)
+          __PYX_ERR(0, 110, __pyx_L1_error)
         }
-        __pyx_t_5 = __Pyx_GetItemInt_List(__pyx_v_robot_links, __pyx_v_l_idx, int, 1, __Pyx_PyInt_From_int, 1, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 157, __pyx_L1_error)
+        __pyx_t_5 = __Pyx_GetItemInt_List(__pyx_v_robot_links, __pyx_v_l_idx, int, 1, __Pyx_PyInt_From_int, 1, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 110, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_5);
         __Pyx_XDECREF_SET(__pyx_v_link, __pyx_t_5);
         __pyx_t_5 = 0;
-
+158:         t_l_name = link.name
-
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_link, __pyx_n_s_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 158, __pyx_L1_error)
+
+111:         t_l_name = link.name
+
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_link, __pyx_n_s_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 111, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_5);
-        if (!(likely(PyString_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_5))) __PYX_ERR(0, 158, __pyx_L1_error)
+        if (!(likely(PyString_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_5))) __PYX_ERR(0, 111, __pyx_L1_error)
         __Pyx_XDECREF_SET(__pyx_v_t_l_name, ((PyObject*)__pyx_t_5));
         __pyx_t_5 = 0;
-
 159:         # DEBUGGING
-
 160:         # print(f"checking {t_l_name}")
-
 161: 
-
 162:         # TEST (break out if not one of the defined target links)
-
+163:         if l_name not in check_links[l_idx]:
+
 112:         # DEBUGGING
+
 113:         # print(f"checking {t_l_name}")
+
 114: 
+
 115:         # TEST (break out if not one of the defined target links)
+
+116:         if l_name not in check_links[l_idx]:
        if (unlikely(__pyx_v_check_links == Py_None)) {
           PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
-          __PYX_ERR(0, 163, __pyx_L1_error)
+          __PYX_ERR(0, 116, __pyx_L1_error)
         }
-        __pyx_t_5 = __Pyx_GetItemInt_List(__pyx_v_check_links, __pyx_v_l_idx, int, 1, __Pyx_PyInt_From_int, 1, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 163, __pyx_L1_error)
+        __pyx_t_5 = __Pyx_GetItemInt_List(__pyx_v_check_links, __pyx_v_l_idx, int, 1, __Pyx_PyInt_From_int, 1, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 116, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_5);
-        __pyx_t_10 = (__Pyx_PySequence_ContainsTF(__pyx_v_l_name, __pyx_t_5, Py_NE)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 163, __pyx_L1_error)
+        __pyx_t_10 = (__Pyx_PySequence_ContainsTF(__pyx_v_l_name, __pyx_t_5, Py_NE)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 116, __pyx_L1_error)
         __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
         if (__pyx_t_10) {
 /* … */
         }
-
+164:           break
+
+117:           break
          goto __pyx_L11_break;
-
 165: 
-
 166:         # Skip to next target link if it is to be ignored
-
+167:         if t_l_name in c_ignore_list:
-
        __pyx_t_10 = (__Pyx_PySequence_ContainsTF(__pyx_v_t_l_name, __pyx_v_c_ignore_list, Py_EQ)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 167, __pyx_L1_error)
+
 118: 
+
 119:         # Skip to next target link if it is to be ignored
+
+120:         if t_l_name in c_ignore_list:
+
        __pyx_t_10 = (__Pyx_PySequence_ContainsTF(__pyx_v_t_l_name, __pyx_v_c_ignore_list, Py_EQ)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 120, __pyx_L1_error)
         if (__pyx_t_10) {
 /* … */
         }
-
+168:           continue
+
+121:           continue
          goto __pyx_L10_continue;
-
 169: 
-
 170:         # Skip to next target link if it is the same link as current being checked
-
+171:         if t_l_name == l_name:
-
        __pyx_t_10 = (__Pyx_PyString_Equals(__pyx_v_t_l_name, __pyx_v_l_name, Py_EQ)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 171, __pyx_L1_error)
+
 122: 
+
 123:         # Skip to next target link if it is the same link as current being checked
+
+124:         if t_l_name == l_name:
+
        __pyx_t_10 = (__Pyx_PyString_Equals(__pyx_v_t_l_name, __pyx_v_l_name, Py_EQ)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 124, __pyx_L1_error)
         if (__pyx_t_10) {
 /* … */
         }
-
+172:           continue
+
+125:           continue
          goto __pyx_L10_continue;
-
 173: 
-
 174:         # Evaluate current link's collision shapes
-
+175:         chk_list_len = len(c_check_list)
+
 126: 
+
 127:         # Evaluate current link's collision shapes
+
+128:         chk_list_len = len(c_check_list)
        if (unlikely(__pyx_v_c_check_list == Py_None)) {
           PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
-          __PYX_ERR(0, 175, __pyx_L1_error)
+          __PYX_ERR(0, 128, __pyx_L1_error)
         }
-        __pyx_t_14 = __Pyx_PyList_GET_SIZE(__pyx_v_c_check_list); if (unlikely(__pyx_t_14 == ((Py_ssize_t)-1))) __PYX_ERR(0, 175, __pyx_L1_error)
+        __pyx_t_14 = __Pyx_PyList_GET_SIZE(__pyx_v_c_check_list); if (unlikely(__pyx_t_14 == ((Py_ssize_t)-1))) __PYX_ERR(0, 128, __pyx_L1_error)
         __pyx_v_chk_list_len = __pyx_t_14;
-
+176:         for chk_idx in range(chk_list_len):
+
+129:         for chk_idx in range(chk_list_len):
        __pyx_t_15 = __pyx_v_chk_list_len;
         __pyx_t_16 = __pyx_t_15;
         for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) {
           __pyx_v_chk_idx = __pyx_t_17;
-
+177:           obj = c_check_list[chk_idx]
+
+130:           obj = c_check_list[chk_idx]
          if (unlikely(__pyx_v_c_check_list == Py_None)) {
             PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
-            __PYX_ERR(0, 177, __pyx_L1_error)
+            __PYX_ERR(0, 130, __pyx_L1_error)
           }
-          __pyx_t_5 = __Pyx_GetItemInt_List(__pyx_v_c_check_list, __pyx_v_chk_idx, int, 1, __Pyx_PyInt_From_int, 1, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 177, __pyx_L1_error)
+          __pyx_t_5 = __Pyx_GetItemInt_List(__pyx_v_c_check_list, __pyx_v_chk_idx, int, 1, __Pyx_PyInt_From_int, 1, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 130, __pyx_L1_error)
           __Pyx_GOTREF(__pyx_t_5);
           __Pyx_XDECREF_SET(__pyx_v_obj, __pyx_t_5);
           __pyx_t_5 = 0;
-
+178:           col_list = list(link.collision)
-
          __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_link, __pyx_n_s_collision); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 178, __pyx_L1_error)
+
+131:           col_list = list(link.collision)
+
          __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_link, __pyx_n_s_collision); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 131, __pyx_L1_error)
           __Pyx_GOTREF(__pyx_t_5);
-          __pyx_t_4 = __Pyx_PySequence_ListKeepNew(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 178, __pyx_L1_error)
+          __pyx_t_4 = __Pyx_PySequence_ListKeepNew(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 131, __pyx_L1_error)
           __Pyx_GOTREF(__pyx_t_4);
           __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
           __Pyx_XDECREF_SET(__pyx_v_col_list, ((PyObject*)__pyx_t_4));
           __pyx_t_4 = 0;
-
+179:           col_list_len = len(col_list)
-
          __pyx_t_14 = __Pyx_PyList_GET_SIZE(__pyx_v_col_list); if (unlikely(__pyx_t_14 == ((Py_ssize_t)-1))) __PYX_ERR(0, 179, __pyx_L1_error)
+
+132:           col_list_len = len(col_list)
+
          __pyx_t_14 = __Pyx_PyList_GET_SIZE(__pyx_v_col_list); if (unlikely(__pyx_t_14 == ((Py_ssize_t)-1))) __PYX_ERR(0, 132, __pyx_L1_error)
           __pyx_v_col_list_len = __pyx_t_14;
-
+180:           for col_idx in range(col_list_len):
+
+133:           for col_idx in range(col_list_len):
          __pyx_t_18 = __pyx_v_col_list_len;
           __pyx_t_19 = __pyx_t_18;
           for (__pyx_t_20 = 0; __pyx_t_20 < __pyx_t_19; __pyx_t_20+=1) {
             __pyx_v_col_idx = __pyx_t_20;
-
+181:             t_obj = col_list[col_idx]
-
            __pyx_t_4 = __Pyx_GetItemInt_List(__pyx_v_col_list, __pyx_v_col_idx, int, 1, __Pyx_PyInt_From_int, 1, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 181, __pyx_L1_error)
+
+134:             t_obj = col_list[col_idx]
+
            __pyx_t_4 = __Pyx_GetItemInt_List(__pyx_v_col_list, __pyx_v_col_idx, int, 1, __Pyx_PyInt_From_int, 1, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 134, __pyx_L1_error)
             __Pyx_GOTREF(__pyx_t_4);
             __Pyx_XDECREF_SET(__pyx_v_t_obj, __pyx_t_4);
             __pyx_t_4 = 0;
-
 182: 
-
 183:             # Get the distance for comparison
-
 184:             # print(f"obj: {t_obj}")
-
+185:             d, _, _ = t_obj.closest_point(obj)
-
            __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_t_obj, __pyx_n_s_closest_point); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 185, __pyx_L1_error)
+
 135: 
+
 136:             # Get the distance for comparison
+
 137:             # print(f"obj: {t_obj}")
+
+138:             d, _, _ = t_obj.closest_point(obj)
+
            __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_t_obj, __pyx_n_s_closest_point); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 138, __pyx_L1_error)
             __Pyx_GOTREF(__pyx_t_5);
             __pyx_t_21 = NULL;
             __pyx_t_22 = 0;
@@ -1922,7 +1458,7 @@
               PyObject *__pyx_callargs[2] = {__pyx_t_21, __pyx_v_obj};
               __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_22, 1+__pyx_t_22);
               __Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0;
-              if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 185, __pyx_L1_error)
+              if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 138, __pyx_L1_error)
               __Pyx_GOTREF(__pyx_t_4);
               __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
             }
@@ -1932,7 +1468,7 @@
               if (unlikely(size != 3)) {
                 if (size > 3) __Pyx_RaiseTooManyValuesError(3);
                 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
-                __PYX_ERR(0, 185, __pyx_L1_error)
+                __PYX_ERR(0, 138, __pyx_L1_error)
               }
               #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
               if (likely(PyTuple_CheckExact(sequence))) {
@@ -1948,17 +1484,17 @@
               __Pyx_INCREF(__pyx_t_21);
               __Pyx_INCREF(__pyx_t_23);
               #else
-              __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 185, __pyx_L1_error)
+              __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 138, __pyx_L1_error)
               __Pyx_GOTREF(__pyx_t_5);
-              __pyx_t_21 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 185, __pyx_L1_error)
+              __pyx_t_21 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 138, __pyx_L1_error)
               __Pyx_GOTREF(__pyx_t_21);
-              __pyx_t_23 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 185, __pyx_L1_error)
+              __pyx_t_23 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 138, __pyx_L1_error)
               __Pyx_GOTREF(__pyx_t_23);
               #endif
               __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
             } else {
               Py_ssize_t index = -1;
-              __pyx_t_24 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 185, __pyx_L1_error)
+              __pyx_t_24 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 138, __pyx_L1_error)
               __Pyx_GOTREF(__pyx_t_24);
               __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
               __pyx_t_25 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_24);
@@ -1968,7 +1504,7 @@
               __Pyx_GOTREF(__pyx_t_21);
               index = 2; __pyx_t_23 = __pyx_t_25(__pyx_t_24); if (unlikely(!__pyx_t_23)) goto __pyx_L19_unpacking_failed;
               __Pyx_GOTREF(__pyx_t_23);
-              if (__Pyx_IternextUnpackEndCheck(__pyx_t_25(__pyx_t_24), 3) < 0) __PYX_ERR(0, 185, __pyx_L1_error)
+              if (__Pyx_IternextUnpackEndCheck(__pyx_t_25(__pyx_t_24), 3) < 0) __PYX_ERR(0, 138, __pyx_L1_error)
               __pyx_t_25 = NULL;
               __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
               goto __pyx_L20_unpacking_done;
@@ -1976,7 +1512,7 @@
               __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
               __pyx_t_25 = NULL;
               if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
-              __PYX_ERR(0, 185, __pyx_L1_error)
+              __PYX_ERR(0, 138, __pyx_L1_error)
               __pyx_L20_unpacking_done:;
             }
             __Pyx_XDECREF_SET(__pyx_v_d, __pyx_t_5);
@@ -1985,16 +1521,16 @@
             __pyx_t_21 = 0;
             __Pyx_DECREF_SET(__pyx_v__, __pyx_t_23);
             __pyx_t_23 = 0;
-
 186:             # print(f"d is: {d}")
-
+187:             if d is not None and d <= 0:
+
 139:             # print(f"d is: {d}")
+
+140:             if d is not None and d <= 0:
            __pyx_t_11 = (__pyx_v_d != Py_None);
             if (__pyx_t_11) {
             } else {
               __pyx_t_10 = __pyx_t_11;
               goto __pyx_L22_bool_binop_done;
             }
-            __pyx_t_4 = PyObject_RichCompare(__pyx_v_d, __pyx_int_0, Py_LE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 187, __pyx_L1_error)
-            __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 187, __pyx_L1_error)
+            __pyx_t_4 = PyObject_RichCompare(__pyx_v_d, __pyx_int_0, Py_LE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 140, __pyx_L1_error)
+            __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 140, __pyx_L1_error)
             __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
             __pyx_t_10 = __pyx_t_11;
             __pyx_L22_bool_binop_done:;
@@ -2006,19 +1542,19 @@
         __pyx_L10_continue:;
       }
       __pyx_L11_break:;
-
 188:               # Returns the link idx in collision
-
+189:               return l_idx
+
 141:               # Returns the link idx in collision
+
+142:               return l_idx
              __pyx_r = __pyx_v_l_idx;
               __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
               goto __pyx_L0;
-
 190: 
-
 191:   # Got here without issue
-
+192:   return -1
+
 143: 
+
 144:   # Got here without issue
+
+145:   return -1
  __pyx_r = -1;
   goto __pyx_L0;
-
 193: 
-
+194: cpdef int test (int val1, int val2):
-
static PyObject *__pyx_pw_17collision_handler_7test(PyObject *__pyx_self, 
+
 146: 
+
+147: cpdef int test (int val1, int val2):
+
static PyObject *__pyx_pw_17collision_handler_5test(PyObject *__pyx_self, 
 #if CYTHON_METH_FASTCALL
 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
 #else
@@ -2034,15 +1570,15 @@
 }
 
 /* Python wrapper */
-static PyObject *__pyx_pw_17collision_handler_7test(PyObject *__pyx_self, 
+static PyObject *__pyx_pw_17collision_handler_5test(PyObject *__pyx_self, 
 #if CYTHON_METH_FASTCALL
 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
 #else
 PyObject *__pyx_args, PyObject *__pyx_kwds
 #endif
 ); /*proto*/
-static PyMethodDef __pyx_mdef_17collision_handler_7test = {"test", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_17collision_handler_7test, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
-static PyObject *__pyx_pw_17collision_handler_7test(PyObject *__pyx_self, 
+static PyMethodDef __pyx_mdef_17collision_handler_5test = {"test", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_17collision_handler_5test, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
+static PyObject *__pyx_pw_17collision_handler_5test(PyObject *__pyx_self, 
 #if CYTHON_METH_FASTCALL
 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
 #else
@@ -2086,7 +1622,7 @@
           (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
           kw_args--;
         }
-        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 194, __pyx_L3_error)
+        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 147, __pyx_L3_error)
         else goto __pyx_L5_argtuple_error;
         CYTHON_FALLTHROUGH;
         case  1:
@@ -2094,14 +1630,14 @@
           (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
           kw_args--;
         }
-        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 194, __pyx_L3_error)
+        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 147, __pyx_L3_error)
         else {
-          __Pyx_RaiseArgtupleInvalid("test", 1, 2, 2, 1); __PYX_ERR(0, 194, __pyx_L3_error)
+          __Pyx_RaiseArgtupleInvalid("test", 1, 2, 2, 1); __PYX_ERR(0, 147, __pyx_L3_error)
         }
       }
       if (unlikely(kw_args > 0)) {
         const Py_ssize_t kwd_pos_args = __pyx_nargs;
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "test") < 0)) __PYX_ERR(0, 194, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "test") < 0)) __PYX_ERR(0, 147, __pyx_L3_error)
       }
     } else if (unlikely(__pyx_nargs != 2)) {
       goto __pyx_L5_argtuple_error;
@@ -2109,12 +1645,12 @@
       values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
       values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
     }
-    __pyx_v_val1 = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_val1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 194, __pyx_L3_error)
-    __pyx_v_val2 = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_val2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 194, __pyx_L3_error)
+    __pyx_v_val1 = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_val1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 147, __pyx_L3_error)
+    __pyx_v_val2 = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_val2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 147, __pyx_L3_error)
   }
   goto __pyx_L6_skip;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("test", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 194, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("test", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 147, __pyx_L3_error)
   __pyx_L6_skip:;
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L3_error:;
@@ -2128,7 +1664,7 @@
   __Pyx_RefNannyFinishContext();
   return NULL;
   __pyx_L4_argument_unpacking_done:;
-  __pyx_r = __pyx_pf_17collision_handler_6test(__pyx_self, __pyx_v_val1, __pyx_v_val2);
+  __pyx_r = __pyx_pf_17collision_handler_4test(__pyx_self, __pyx_v_val1, __pyx_v_val2);
   int __pyx_lineno = 0;
   const char *__pyx_filename = NULL;
   int __pyx_clineno = 0;
@@ -2144,11 +1680,11 @@
   return __pyx_r;
 }
 
-static PyObject *__pyx_pf_17collision_handler_6test(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_val1, int __pyx_v_val2) {
+static PyObject *__pyx_pf_17collision_handler_4test(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_val1, int __pyx_v_val2) {
   PyObject *__pyx_r = NULL;
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __pyx_f_17collision_handler_test(__pyx_v_val1, __pyx_v_val2, 0); if (unlikely(__pyx_t_1 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 194, __pyx_L1_error)
-  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 194, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_17collision_handler_test(__pyx_v_val1, __pyx_v_val2, 0); if (unlikely(__pyx_t_1 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 147, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 147, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __pyx_r = __pyx_t_2;
   __pyx_t_2 = 0;
@@ -2165,15 +1701,15 @@
   return __pyx_r;
 }
 /* … */
-  __pyx_tuple__10 = PyTuple_Pack(2, __pyx_n_s_val1, __pyx_n_s_val2); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 194, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__10);
-  __Pyx_GIVEREF(__pyx_tuple__10);
+  __pyx_tuple__5 = PyTuple_Pack(2, __pyx_n_s_val1, __pyx_n_s_val2); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 147, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__5);
+  __Pyx_GIVEREF(__pyx_tuple__5);
 /* … */
-  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_17collision_handler_7test, 0, __pyx_n_s_test, NULL, __pyx_n_s_collision_handler, __pyx_d, ((PyObject *)__pyx_codeobj__11)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 194, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_4);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_4) < 0) __PYX_ERR(0, 194, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-
+195:   return val1 + val2
+ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_17collision_handler_5test, 0, __pyx_n_s_test, NULL, __pyx_n_s_collision_handler, __pyx_d, ((PyObject *)__pyx_codeobj__6)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 147, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(0, 147, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; +
+148:   return val1 + val2
  __pyx_r = (__pyx_v_val1 + __pyx_v_val2);
   goto __pyx_L0;
 
diff --git a/armer/cython/collision_handler.pyx b/armer/cython/collision_handler.pyx index df363da..e53209b 100644 --- a/armer/cython/collision_handler.pyx +++ b/armer/cython/collision_handler.pyx @@ -3,59 +3,12 @@ from libcpp.list cimport list as cpplist from libcpp.string cimport string cimport cython -import numpy as np -cimport numpy as cnp -cnp.import_array() -DTYPE = np.float64 -ctypedef cnp.float64_t DTYPE_t - cdef extern from "" namespace "std": cdef cppclass vector[T]: void push_back(T&) nogil size_t size() T& operator[](size_t) -@cython.wraparound(False) -cpdef dict closest_dist_query(str sliced_link_name, - list col_link_names, - int col_link_name_len, - dict col_dict, - dict overlap_dict): - - cdef int col_link_idx - cdef cnp.ndarray dist - cdef list c_obj_list - cdef list slice_obj_list - # cdef list out_list - # cdef vector[float] dist_list - # cdef vector[vector[DTYPE_t]] out_list - cdef dict out_dict = {} - # cdef float temp - cdef str link - - # Method definition - # push_back_main = out_list.push_back - # push_back = dist_list.push_back - for col_link_idx in range(col_link_name_len): - # Only add to output list if within the following criteria - link = col_link_names[col_link_idx] - c_obj_list = col_dict[link] - slice_obj_list = col_dict[sliced_link_name] - if c_obj_list == [] or slice_obj_list == []: - continue - - if link in overlap_dict[sliced_link_name]: - continue - - # if col_link_names[col_link_idx] not in overlap_dict[sliced_link_name]: - # Calculate the closest point distance between first shape available - _, _, dist = slice_obj_list[0].closest_point(c_obj_list[0]) - # out_dict[col_link_names[col_link_idx]] = dist[2] - # out_list.push_back(dist[2]) - out_dict[link] = dist - - return out_dict - # Ignore negative indice checking (i.e., a[-1]) @cython.wraparound(False) cpdef int col_check(list sliced_links, list check_links, int len_links, dict global_dict): diff --git a/armer/robots/ROSRobot.py b/armer/robots/ROSRobot.py index d011269..0296f56 100644 --- a/armer/robots/ROSRobot.py +++ b/armer/robots/ROSRobot.py @@ -2028,7 +2028,7 @@ def add_collision_obj_cb(self, req: AddCollisionObjectRequest) -> AddCollisionOb # Handle radius and length defaulting on 0 radius = req.radius if req.radius else 0.05 #default in m length = req.length if req.length else 0.1 #default in m - rospy.loginfo(f"radius is: {radius} | length is: {length}") + # rospy.loginfo(f"radius is: {radius} | length is: {length}") # Handle pose input error if req.pose == None or req.pose == Pose(): @@ -2071,15 +2071,16 @@ def add_collision_obj_cb(self, req: AddCollisionObjectRequest) -> AddCollisionOb # Create a Dynamic Collision Object and add the configured shape to the scene dynamic_obj = DynamicCollisionObj(shape=shape, key=req.name, pose=req.pose, is_added=False) # NOTE: these dictionaries are accessed and checked by Armer's main loop for addition to a backend. - self.dynamic_collision_dict[req.name] = dynamic_obj - self.collision_dict[req.name] = [dynamic_obj.shape] + with self.lock: + self.dynamic_collision_dict[req.name] = dynamic_obj + self.collision_dict[req.name] = [dynamic_obj.shape] # Add to list of objects for NEO # NOTE: NEO needs more work to avoid local minima # NOTE: Also, existing description shapes (not part of the robot tree) need to be peeled out and added here as well self.collision_obj_list.append(shape) - print(f"Current collision objects: {self.collision_obj_list}") + # print(f"Current collision objects: {self.collision_obj_list}") return AddCollisionObjectResponse(success=True) @@ -2121,50 +2122,22 @@ def add_collision_obj(self, obj): self.collision_obj_list.append(obj) def closest_dist_query(self, sliced_link_name): - # target_shape_translations = [] - # start = timeit.default_timer() - # link_pose_dict = {} - # for link in self.collision_dict.keys(): - - # # Test closest point on existing mesh link - # if self.collision_dict[link] != [] and link not in self.overlapped_link_dict[sliced_link_name]: - # # print(f"current sliced link [{sliced_link.name}] shape 1: {self.collision_dict[sliced_link.name][0]}") - # # print(f"test link [{link}] shape 1: {self.collision_dict[link][0]}") - # dist = self.collision_dict[sliced_link_name][0].closest_point(self.collision_dict[link][0]) - # print(f"p2: {dist[2]}") - # # target_shape_translations.append(dist[2]) - # link_pose_dict[link] = dist[2] - # end = timeit.default_timer() - # print(f"[OLD] closest dist list comp version: {1/(end-start)} hz") - - # start = timeit.default_timer() translation_dict = { link: self.collision_dict[sliced_link_name][0].closest_point(self.collision_dict[link][0])[2] for link in self.collision_dict.keys() if self.collision_dict[link] != [] and link not in self.overlapped_link_dict[sliced_link_name] } - # end = timeit.default_timer() - # print(f"[NEW] closest dist list comp version: {1/(end-start)} hz") - # print(f"[OLD] target_shape_translation: {target_shape_translations}") - # print(f"[NEW] target_shape_translation: {target_shape_translations_new}") - # print(f"comparison: {np.all(target_shape_translations) == np.all(target_shape_translations_new)}") - return translation_dict def closest_dist_query_old(self, sliced_link_name): - translation_dict = {} - for link in self.collision_dict.keys(): - - # Test closest point on existing mesh link - # NOTE: this method only cares about existing links in robot tree (not dynamically added). - # Robot tree can include 'external' items by being included in the robot's description. - if link in self.link_dict.keys() and self.collision_dict[link] != [] and link not in self.overlapped_link_dict[sliced_link_name]: - # print(f"current sliced link [{sliced_link.name}] shape 1: {self.collision_dict[sliced_link.name][0]}") - # print(f"test link [{link}] shape 1: {self.collision_dict[link][0]}") - # dist = self.collision_dict[sliced_link_name][0].closest_point(self.collision_dict[link][0]) - dist = self.ets(start=sliced_link_name, end=link).eval(self.q)[:3, 3] - # print(f"p2: {dist[2]}") - translation_dict[link] = dist + # Test closest point on existing mesh link + # NOTE: this method only cares about existing links in robot tree (not dynamically added). + # Robot tree can include 'external' items by being included in the robot's description. + translation_dict = { + link: self.ets(start=sliced_link_name, end=link).eval(self.q)[:3, 3] + for link in self.collision_dict.keys() + if link in self.link_dict.keys() and self.collision_dict[link] != [] and link not in self.overlapped_link_dict[sliced_link_name] + } return translation_dict @@ -2256,23 +2229,14 @@ def query_kd_nn_collision_tree(self, sliced_links: list = [], dim: int = 5, debu # For the current sliced link; find the closest point between one of the link's shapes # NOTE: each link can have multiple shapes, but in the first instance, we take only one shape per link to # understand the distance to then calculate the target links via the KDTree + col_dict_copy = self.collision_dict.copy() + check_links = [] for sliced_link in sliced_links: # Early termination on error if sliced_link.name not in self.link_dict.keys(): rospy.logerr(f"Given sliced link: {sliced_link.name} is not valid. Skipping...") continue - - # Get the closest distances to each link based on each link's initial shape - # NOTE: a link can have more than 1 shape, so this aims to only get a general distance to the first - # in order to characterise the distance to that link in a general way - # TODO: instead of shapes, we could look at the mesh, but this needs to be collision enabled to work - # using the built-in methods of the Shape class. - # start = timeit.default_timer() - # translation_dict = self.closest_dist_query(sliced_link_name=sliced_link.name) - # end = timeit.default_timer() - # print(f"[NEW] Get distances to links from target: {1/(end-start)} hz") - # # Initial approach to get closest link (based on origin, not surface) # # NOTE: as it is based on origin, the size/shape of collision object matters # start = timeit.default_timer() @@ -2280,19 +2244,17 @@ def query_kd_nn_collision_tree(self, sliced_links: list = [], dim: int = 5, debu # end = timeit.default_timer() # print(f"[OLD] Get distances to links from target: {1/(end-start)} hz") - # Cython implementation of above + # Get the closest distances to each link based on each link's initial shape + # NOTE: a link can have more than 1 shape, so this aims to only get a general distance to the first + # in order to characterise the distance to that link in a general way + # TODO: instead of shapes, we could look at the mesh, but this needs to be collision enabled to work + # using the built-in methods of the Shape class. start = timeit.default_timer() - translation_dict = collision_handler.closest_dist_query( - sliced_link_name=sliced_link.name, - col_link_names=list(self.collision_dict.keys()), - col_link_name_len=len(list(self.collision_dict.keys())), - col_dict=self.collision_dict, - overlap_dict=self.overlapped_link_dict) + translation_dict = self.closest_dist_query(sliced_link_name=sliced_link.name) end = timeit.default_timer() - print(f"[CYTHON] Get distances to links from target: {1/(end-start)} hz") - # print(f"translation_dict from cython: {translation_dict}") - # Create a tree for look up - tree = KDTree(data=list(translation_dict.values())) + # print(f"[NEW] Get distances to links from target: {1/(end-start)} hz") + + tree = KDTree(data=list(translation_dict.copy().values())) target_position = self.ets(start=self.base_link, end=sliced_link).eval(self.q)[:3, 3] # Test query of nearest neighbors for a specific shape (3D) as origin (given tree is from source) dist, ind = tree.query(X=[target_position], k=dim, dualtree=True)